diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..2ece5737 --- /dev/null +++ b/.gitignore @@ -0,0 +1,138 @@ + +# Created by https://www.toptal.com/developers/gitignore/api/xcode,swift,macos +# Edit at https://www.toptal.com/developers/gitignore?templates=xcode,swift,macos + +### macOS ### +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +### Swift ### +# Xcode +# +# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore + +## User settings +xcuserdata/ + +## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9) +*.xcscmblueprint +*.xccheckout + +## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4) +build/ +DerivedData/ +*.moved-aside +*.pbxuser +!default.pbxuser +*.mode1v3 +!default.mode1v3 +*.mode2v3 +!default.mode2v3 +*.perspectivev3 +!default.perspectivev3 + +## Obj-C/Swift specific +*.hmap + +## App packaging +*.ipa +*.dSYM.zip +*.dSYM + +## Playgrounds +timeline.xctimeline +playground.xcworkspace + +# Swift Package Manager +# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. +# Packages/ +# Package.pins +# Package.resolved +# *.xcodeproj +# Xcode automatically generates this directory with a .xcworkspacedata file and xcuserdata +# hence it is not needed unless you have added a package configuration file to your project +# .swiftpm + +.build/ + +# CocoaPods +# We recommend against adding the Pods directory to your .gitignore. However +# you should judge for yourself, the pros and cons are mentioned at: +# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control +# Pods/ +# Add this line if you want to avoid checking in source code from the Xcode workspace +# *.xcworkspace + +# Carthage +# Add this line if you want to avoid checking in source code from Carthage dependencies. +# Carthage/Checkouts + +Carthage/Build/ + +# Accio dependency management +Dependencies/ +.accio/ + +# fastlane +# It is recommended to not store the screenshots in the git repo. +# Instead, use fastlane to re-generate the screenshots whenever they are needed. +# For more information about the recommended setup visit: +# https://docs.fastlane.tools/best-practices/source-control/#source-control + +fastlane/report.xml +fastlane/Preview.html +fastlane/screenshots/**/*.png +fastlane/test_output + +# Code Injection +# After new code Injection tools there's a generated folder /iOSInjectionProject +# https://github.com/johnno1962/injectionforxcode + +iOSInjectionProject/ + +### Xcode ### +# Xcode +# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore + + + + +## Gcc Patch +/*.gcno + +### Xcode Patch ### +*.xcodeproj/* +!*.xcodeproj/project.pbxproj +!*.xcodeproj/xcshareddata/ +!*.xcworkspace/contents.xcworkspacedata +**/xcshareddata/WorkspaceSettings.xcsettings + +# End of https://www.toptal.com/developers/gitignore/api/xcode,swift,macos + +### Project specific files ### +Keys.swift diff --git a/DareFilm/DareFilm.xcodeproj/project.pbxproj b/DareFilm/DareFilm.xcodeproj/project.pbxproj new file mode 100644 index 00000000..87399eb7 --- /dev/null +++ b/DareFilm/DareFilm.xcodeproj/project.pbxproj @@ -0,0 +1,385 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXBuildFile section */ + F5301BD5269072A800CC3AEF /* Keys.swift in Sources */ = {isa = PBXBuildFile; fileRef = F5301BD4269072A800CC3AEF /* Keys.swift */; }; + F5301BD726907F5900CC3AEF /* ImageHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = F5301BD626907F5900CC3AEF /* ImageHandler.swift */; }; + F581A4B5268F2E4200CCD578 /* HomeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F581A4B4268F2E4200CCD578 /* HomeView.swift */; }; + F581A4B7268F2F8000CCD578 /* MovieListView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F581A4B6268F2F8000CCD578 /* MovieListView.swift */; }; + F581A4B9268F301400CCD578 /* MovieView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F581A4B8268F301400CCD578 /* MovieView.swift */; }; + F581A4BF268F35D100CCD578 /* Movie.swift in Sources */ = {isa = PBXBuildFile; fileRef = F581A4BE268F35D100CCD578 /* Movie.swift */; }; + F581A4C1268F3A6D00CCD578 /* MovieDetailView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F581A4C0268F3A6D00CCD578 /* MovieDetailView.swift */; }; + F581A4C3268F44D800CCD578 /* MovieViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = F581A4C2268F44D800CCD578 /* MovieViewModel.swift */; }; + F5D3BB9E268DE775006D1C26 /* DareFilmApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = F5D3BB9D268DE775006D1C26 /* DareFilmApp.swift */; }; + F5D3BBA2268DE775006D1C26 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F5D3BBA1268DE775006D1C26 /* Assets.xcassets */; }; + F5D3BBA5268DE775006D1C26 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F5D3BBA4268DE775006D1C26 /* Preview Assets.xcassets */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + F5301BD4269072A800CC3AEF /* Keys.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Keys.swift; sourceTree = ""; }; + F5301BD626907F5900CC3AEF /* ImageHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ImageHandler.swift; sourceTree = ""; }; + F581A4B4268F2E4200CCD578 /* HomeView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeView.swift; sourceTree = ""; }; + F581A4B6268F2F8000CCD578 /* MovieListView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MovieListView.swift; sourceTree = ""; }; + F581A4B8268F301400CCD578 /* MovieView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MovieView.swift; sourceTree = ""; }; + F581A4BE268F35D100CCD578 /* Movie.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Movie.swift; sourceTree = ""; }; + F581A4C0268F3A6D00CCD578 /* MovieDetailView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MovieDetailView.swift; sourceTree = ""; }; + F581A4C2268F44D800CCD578 /* MovieViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MovieViewModel.swift; sourceTree = ""; }; + F5D3BB9A268DE775006D1C26 /* DareFilm.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = DareFilm.app; sourceTree = BUILT_PRODUCTS_DIR; }; + F5D3BB9D268DE775006D1C26 /* DareFilmApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DareFilmApp.swift; sourceTree = ""; }; + F5D3BBA1268DE775006D1C26 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + F5D3BBA4268DE775006D1C26 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; + F5D3BBA6268DE775006D1C26 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + F5D3BB97268DE775006D1C26 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + F5D3BB91268DE775006D1C26 = { + isa = PBXGroup; + children = ( + F5D3BB9C268DE775006D1C26 /* DareFilm */, + F5D3BB9B268DE775006D1C26 /* Products */, + ); + sourceTree = ""; + }; + F5D3BB9B268DE775006D1C26 /* Products */ = { + isa = PBXGroup; + children = ( + F5D3BB9A268DE775006D1C26 /* DareFilm.app */, + ); + name = Products; + sourceTree = ""; + }; + F5D3BB9C268DE775006D1C26 /* DareFilm */ = { + isa = PBXGroup; + children = ( + F5D3BBAE268DE8EF006D1C26 /* Views */, + F5D3BBAD268DE8E5006D1C26 /* ViewModels */, + F5D3BBAC268DE8D9006D1C26 /* Models */, + F5D3BB9D268DE775006D1C26 /* DareFilmApp.swift */, + F5D3BBA1268DE775006D1C26 /* Assets.xcassets */, + F5D3BBA6268DE775006D1C26 /* Info.plist */, + F5D3BBA3268DE775006D1C26 /* Preview Content */, + F5301BD4269072A800CC3AEF /* Keys.swift */, + ); + path = DareFilm; + sourceTree = ""; + }; + F5D3BBA3268DE775006D1C26 /* Preview Content */ = { + isa = PBXGroup; + children = ( + F5D3BBA4268DE775006D1C26 /* Preview Assets.xcassets */, + ); + path = "Preview Content"; + sourceTree = ""; + }; + F5D3BBAC268DE8D9006D1C26 /* Models */ = { + isa = PBXGroup; + children = ( + F581A4BE268F35D100CCD578 /* Movie.swift */, + ); + path = Models; + sourceTree = ""; + }; + F5D3BBAD268DE8E5006D1C26 /* ViewModels */ = { + isa = PBXGroup; + children = ( + F581A4C2268F44D800CCD578 /* MovieViewModel.swift */, + F5301BD626907F5900CC3AEF /* ImageHandler.swift */, + ); + path = ViewModels; + sourceTree = ""; + }; + F5D3BBAE268DE8EF006D1C26 /* Views */ = { + isa = PBXGroup; + children = ( + F581A4B4268F2E4200CCD578 /* HomeView.swift */, + F581A4B6268F2F8000CCD578 /* MovieListView.swift */, + F581A4B8268F301400CCD578 /* MovieView.swift */, + F581A4C0268F3A6D00CCD578 /* MovieDetailView.swift */, + ); + path = Views; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + F5D3BB99268DE775006D1C26 /* DareFilm */ = { + isa = PBXNativeTarget; + buildConfigurationList = F5D3BBA9268DE775006D1C26 /* Build configuration list for PBXNativeTarget "DareFilm" */; + buildPhases = ( + F5D3BB96268DE775006D1C26 /* Sources */, + F5D3BB97268DE775006D1C26 /* Frameworks */, + F5D3BB98268DE775006D1C26 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = DareFilm; + productName = DareFilm; + productReference = F5D3BB9A268DE775006D1C26 /* DareFilm.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + F5D3BB92268DE775006D1C26 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 1250; + LastUpgradeCheck = 1250; + TargetAttributes = { + F5D3BB99268DE775006D1C26 = { + CreatedOnToolsVersion = 12.5.1; + }; + }; + }; + buildConfigurationList = F5D3BB95268DE775006D1C26 /* Build configuration list for PBXProject "DareFilm" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = F5D3BB91268DE775006D1C26; + productRefGroup = F5D3BB9B268DE775006D1C26 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + F5D3BB99268DE775006D1C26 /* DareFilm */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + F5D3BB98268DE775006D1C26 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + F5D3BBA5268DE775006D1C26 /* Preview Assets.xcassets in Resources */, + F5D3BBA2268DE775006D1C26 /* Assets.xcassets in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + F5D3BB96268DE775006D1C26 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + F581A4C1268F3A6D00CCD578 /* MovieDetailView.swift in Sources */, + F5301BD5269072A800CC3AEF /* Keys.swift in Sources */, + F581A4B9268F301400CCD578 /* MovieView.swift in Sources */, + F581A4B5268F2E4200CCD578 /* HomeView.swift in Sources */, + F581A4BF268F35D100CCD578 /* Movie.swift in Sources */, + F581A4B7268F2F8000CCD578 /* MovieListView.swift in Sources */, + F581A4C3268F44D800CCD578 /* MovieViewModel.swift in Sources */, + F5301BD726907F5900CC3AEF /* ImageHandler.swift in Sources */, + F5D3BB9E268DE775006D1C26 /* DareFilmApp.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + F5D3BBA7268DE775006D1C26 /* 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_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 = 14.5; + 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; + }; + F5D3BBA8268DE775006D1C26 /* 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_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 = 14.5; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + F5D3BBAA268DE775006D1C26 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_ASSET_PATHS = "\"DareFilm/Preview Content\""; + DEVELOPMENT_TEAM = 762W6V8USZ; + ENABLE_PREVIEWS = YES; + INFOPLIST_FILE = DareFilm/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = loor.DareFilm; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + F5D3BBAB268DE775006D1C26 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_ASSET_PATHS = "\"DareFilm/Preview Content\""; + DEVELOPMENT_TEAM = 762W6V8USZ; + ENABLE_PREVIEWS = YES; + INFOPLIST_FILE = DareFilm/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = loor.DareFilm; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + F5D3BB95268DE775006D1C26 /* Build configuration list for PBXProject "DareFilm" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + F5D3BBA7268DE775006D1C26 /* Debug */, + F5D3BBA8268DE775006D1C26 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + F5D3BBA9268DE775006D1C26 /* Build configuration list for PBXNativeTarget "DareFilm" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + F5D3BBAA268DE775006D1C26 /* Debug */, + F5D3BBAB268DE775006D1C26 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = F5D3BB92268DE775006D1C26 /* Project object */; +} diff --git a/DareFilm/DareFilm.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/DareFilm/DareFilm.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 00000000..919434a6 --- /dev/null +++ b/DareFilm/DareFilm.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/DareFilm/DareFilm.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/DareFilm/DareFilm.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 00000000..18d98100 --- /dev/null +++ b/DareFilm/DareFilm.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/DareFilm/DareFilm/Assets.xcassets/AccentColor.colorset/Contents.json b/DareFilm/DareFilm/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 00000000..eb878970 --- /dev/null +++ b/DareFilm/DareFilm/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/DareFilm/DareFilm/Assets.xcassets/AppIcon.appiconset/Contents.json b/DareFilm/DareFilm/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 00000000..9221b9bb --- /dev/null +++ b/DareFilm/DareFilm/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,98 @@ +{ + "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 + } +} diff --git a/DareFilm/DareFilm/Assets.xcassets/BackgroundColor.colorset/Contents.json b/DareFilm/DareFilm/Assets.xcassets/BackgroundColor.colorset/Contents.json new file mode 100644 index 00000000..2b3d9a22 --- /dev/null +++ b/DareFilm/DareFilm/Assets.xcassets/BackgroundColor.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "196", + "green" : "228", + "red" : "255" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "20", + "green" : "20", + "red" : "20" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/DareFilm/DareFilm/Assets.xcassets/Contents.json b/DareFilm/DareFilm/Assets.xcassets/Contents.json new file mode 100644 index 00000000..73c00596 --- /dev/null +++ b/DareFilm/DareFilm/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/DareFilm/DareFilm/DareFilmApp.swift b/DareFilm/DareFilm/DareFilmApp.swift new file mode 100644 index 00000000..7b231c40 --- /dev/null +++ b/DareFilm/DareFilm/DareFilmApp.swift @@ -0,0 +1,23 @@ +// +// DareFilmApp.swift +// DareFilm +// +// Created by Johannes Loor on 2021-07-01. +// + +import SwiftUI + +@main +struct DareFilmApp: App { + var body: some Scene { + WindowGroup { + ZStack{ + Color("BackgroundColor") + .ignoresSafeArea() + HomeView() + .edgesIgnoringSafeArea(.bottom) + } + + } + } +} diff --git a/DareFilm/DareFilm/Info.plist b/DareFilm/DareFilm/Info.plist new file mode 100644 index 00000000..efc211a0 --- /dev/null +++ b/DareFilm/DareFilm/Info.plist @@ -0,0 +1,50 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + + UIApplicationSupportsIndirectInputEvents + + UILaunchScreen + + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/DareFilm/DareFilm/Models/Movie.swift b/DareFilm/DareFilm/Models/Movie.swift new file mode 100644 index 00000000..5888e158 --- /dev/null +++ b/DareFilm/DareFilm/Models/Movie.swift @@ -0,0 +1,23 @@ +// +// Movie.swift +// DareFilm +// +// Created by Johannes Loor on 2021-07-02. +// + +import Foundation + +struct MovieDataResponse: Codable { + var results: [Movie] +} + +struct Movie: Identifiable, Codable { + var id: Int + var title: String + var overview: String + var voteAverage: Double + var posterPath: String + var backdropPath: String? + var releaseDate: String? + var voteCount: Int +} diff --git a/DareFilm/DareFilm/Preview Content/Preview Assets.xcassets/Contents.json b/DareFilm/DareFilm/Preview Content/Preview Assets.xcassets/Contents.json new file mode 100644 index 00000000..73c00596 --- /dev/null +++ b/DareFilm/DareFilm/Preview Content/Preview Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/DareFilm/DareFilm/ViewModels/ImageHandler.swift b/DareFilm/DareFilm/ViewModels/ImageHandler.swift new file mode 100644 index 00000000..345d9a76 --- /dev/null +++ b/DareFilm/DareFilm/ViewModels/ImageHandler.swift @@ -0,0 +1,51 @@ +// +// ImageHandler.swift +// DareFilm +// +// Created by Johannes Loor on 2021-07-03. +// + +import Foundation +import SwiftUI + +enum imageSize: String { + case w92, w154, w185, w342, w500, w780, original //Poster sizes + case w300, w1280 //Extra Backdrop sizes along with w780 and original +} + +/* + Handles and fecthes the images from TMDB + */ +class ImageHandler: ObservableObject { + @Published private(set) var image: UIImage? + + /** + Fetches images from TMDB + + -Parameters: + - imagePath: The specific image path of the url + - size: The optional size of the image + + -Returns: Puts the returning image in the image property wrapper + */ + func loadImage(withPath imagePath: String?, size: imageSize? = .w500){ + if imagePath == nil{ + print("Error: no image path") + return + } + guard let url = URL(string: "https://image.tmdb.org/t/p/\(size!.rawValue)\(imagePath!)") else{ + print("Image url broken") + return + } + + URLSession.shared.dataTask(with: url) { data, _, error in + if let data = data { + DispatchQueue.main.sync { + self.image = UIImage(data: data) ?? UIImage() + } + return + } + print("Error while downloading image. Error: \(String(describing: error))") + }.resume() + } +} diff --git a/DareFilm/DareFilm/ViewModels/MovieViewModel.swift b/DareFilm/DareFilm/ViewModels/MovieViewModel.swift new file mode 100644 index 00000000..52690791 --- /dev/null +++ b/DareFilm/DareFilm/ViewModels/MovieViewModel.swift @@ -0,0 +1,64 @@ +// +// MovieViewModel.swift +// DareFilm +// +// Created by Johannes Loor on 2021-07-02. +// + +import Foundation + +enum movieFilter { + case popular, topRated +} + +/* + Handles and fecthes the data from TMDB + */ +class MovieHandler: ObservableObject { + @Published var popularMovies: [Movie] = [] + @Published var topRatedMovies: [Movie] = [] + let apiKey = TMDBapiKey //TODO: Add your TMDB key here (string) + + /** + Fetches movie data from TMDB + + -Parameter filter: The order type to filter the data on (popular or top rated) + -Returns: Adds movies to the corresponing property wrapper + */ + func fetchMovieData(withFilter filter: movieFilter) { + var filterType: String { + switch filter { + case .popular: + return "popular" + case .topRated: + return "top_rated" + } + } + + guard let url = URL(string: "https://api.themoviedb.org/3/movie/\(filterType)?api_key=\(apiKey)&language=en-US&page=1") else{ + print("Data url broken") + return + } + + URLSession.shared.dataTask(with: url){ data, _, error in + if let data = data { + let decoder = JSONDecoder() + decoder.keyDecodingStrategy = .convertFromSnakeCase + if let decodedResponse = try? decoder.decode(MovieDataResponse.self, from: data) { + DispatchQueue.main.async { + switch filter{ + case .popular: + self.popularMovies = decodedResponse.results + + case .topRated: + self.topRatedMovies = decodedResponse.results + } + } + return + } + } + print("Error while downloading data. Error: \(String(describing: error))") + + }.resume() + } +} diff --git a/DareFilm/DareFilm/Views/HomeView.swift b/DareFilm/DareFilm/Views/HomeView.swift new file mode 100644 index 00000000..fc5ac6e4 --- /dev/null +++ b/DareFilm/DareFilm/Views/HomeView.swift @@ -0,0 +1,67 @@ +// +// HomeView.swift +// DareFilm +// +// Created by Johannes Loor on 2021-07-02. +// + +import SwiftUI + +/* + First landing page of the app, building the overall structure + */ +struct HomeView: View { + @State private var tabSelection = "Popular" + @ObservedObject var movieHandler = MovieHandler() + let popularSectionTitle = "Popular" + let ratedSectionTitile = "Top rated" + + var body: some View { + VStack(spacing: 0){ + // MARK: Title + Text("DareFilm") + .font(.title) + .padding() + + //MARK: Top selection bar + HStack{ + Spacer() + Button(tabSelection == popularSectionTitle ? "\(popularSectionTitle)🍿" : popularSectionTitle){ + tabSelection = popularSectionTitle + } + .foregroundColor(tabSelection == popularSectionTitle ? .primary : .gray) + + Spacer() + + Button(tabSelection == ratedSectionTitile ? "🍿\(ratedSectionTitile)" : ratedSectionTitile){ + tabSelection = ratedSectionTitile + } + .foregroundColor(tabSelection == ratedSectionTitile ? .primary : .gray) + Spacer() + } + .font(.headline) + .padding(.bottom) + Divider() + + //MARK: Tabview content + TabView(selection: $tabSelection){ + MovieListView(movies: movieHandler.popularMovies) + .tag(popularSectionTitle) + .onAppear(){ + if movieHandler.popularMovies.isEmpty{ + movieHandler.fetchMovieData(withFilter: .popular) + } + } + + MovieListView(movies: movieHandler.topRatedMovies) + .tag(ratedSectionTitile) + .onAppear(){ + if movieHandler.topRatedMovies.isEmpty{ + movieHandler.fetchMovieData(withFilter: .topRated) + } + } + } + .tabViewStyle(PageTabViewStyle(indexDisplayMode: .never)) + } + } +} diff --git a/DareFilm/DareFilm/Views/MovieDetailView.swift b/DareFilm/DareFilm/Views/MovieDetailView.swift new file mode 100644 index 00000000..2b76647d --- /dev/null +++ b/DareFilm/DareFilm/Views/MovieDetailView.swift @@ -0,0 +1,66 @@ +// +// MovieDetailView.swift +// DareFilm +// +// Created by Johannes Loor on 2021-07-02. +// + +import SwiftUI +/* + The detailed movie description + */ +struct MovieDetailView: View { + @ObservedObject var imageHandler = ImageHandler() + @Binding var isShowing: Bool + var movie: Movie + var body: some View { + VStack{ + ZStack{ + //MARK: Background and placeholder + Rectangle() + .fill(Color.yellow) + .frame(minHeight: 100) + Text("\(movie.title)") + .italic() + .padding() + + //MARK: Fetched horizontal image + Image(uiImage: imageHandler.image ?? UIImage()) + .resizable() + .onAppear(){ + imageHandler.loadImage(withPath: movie.backdropPath) + } + } + .scaledToFit() + + //MARK: Detailed information + ScrollView{ + Text(movie.title) + .font(.title) + VStack(alignment: .leading){ + + Text("⭐️: \(String(movie.voteAverage))") + .font(.title2) + Text("Number of votes: \(movie.voteCount)") + Text("Released: \(movie.releaseDate ?? "")") + .padding(.top) + Text("Description:") + .italic() + .padding(.top) + Text(movie.overview) + + } + .padding() + Spacer() + } + + //MARK: Button for closing details sheet + Button("Close"){ + isShowing = false + } + .padding(.bottom, 50) + } + .background(Color("BackgroundColor")) + .ignoresSafeArea() + } +} diff --git a/DareFilm/DareFilm/Views/MovieListView.swift b/DareFilm/DareFilm/Views/MovieListView.swift new file mode 100644 index 00000000..d89b98be --- /dev/null +++ b/DareFilm/DareFilm/Views/MovieListView.swift @@ -0,0 +1,29 @@ +// +// MovieListView.swift +// DareFilm +// +// Created by Johannes Loor on 2021-07-02. +// + +import SwiftUI +/* + Lists each movie in a scrollable list + */ +struct MovieListView: View { + var movies: [Movie] + var body: some View { + VStack(alignment: .leading, spacing: 0){ + if movies.isEmpty{ + ProgressView() + } + else{ + ScrollView{ + ForEach(movies){movie in + MovieView(movie: movie) + } + } + } + } + .padding() + } +} diff --git a/DareFilm/DareFilm/Views/MovieView.swift b/DareFilm/DareFilm/Views/MovieView.swift new file mode 100644 index 00000000..c35fc3a7 --- /dev/null +++ b/DareFilm/DareFilm/Views/MovieView.swift @@ -0,0 +1,63 @@ +// +// MovieView.swift +// DareFilm +// +// Created by Johannes Loor on 2021-07-02. +// + +import SwiftUI +/* + The view represtning each movie object + */ +struct MovieView: View { + @ObservedObject var imageHandler = ImageHandler() + @State private var showingDetails = false + var movie: Movie + var body: some View { + HStack{ + ZStack{ + //MARK: Background and placeholder + Rectangle() + .fill(Color.yellow) + .frame(width: 155, height: 235) + + .cornerRadius(20) + + Text("\(movie.title)") + .italic() + .padding() + + //MARK: Fetched poster + Image(uiImage: imageHandler.image ?? UIImage()) + .resizable() + .frame(width: 150, height: 230) + .cornerRadius(20) + .onAppear(){ + imageHandler.loadImage(withPath: movie.posterPath) + } + } + .frame(width: 155, height: 235) + + //MARK: General movie information + VStack(alignment: .leading, spacing: 10){ + Text(movie.title) + .font(.title2) + Text(movie.overview) + .italic() + .lineLimit(3) + Text("⭐️\(String(movie.voteAverage))") + } + Spacer() + } + .padding(.bottom) + .onTapGesture { + let hapticGenerator = UIImpactFeedbackGenerator(style: .light) + hapticGenerator.impactOccurred() + showingDetails.toggle() + } + //MARK: Detailed movie sheet shown on tap + .sheet(isPresented: $showingDetails) { + MovieDetailView(isShowing: $showingDetails, movie: movie) + } + } +}