mirror of
https://github.com/ivanvorobei/SwiftUI.git
synced 2026-03-23 09:51:21 +01:00
Add projects
This commit is contained in:
451
Examples/Movie/MovieSwift/MovieSwift.xcodeproj/project.pbxproj
Executable file
451
Examples/Movie/MovieSwift/MovieSwift.xcodeproj/project.pbxproj
Executable file
@@ -0,0 +1,451 @@
|
||||
// !$*UTF8*$!
|
||||
{
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 50;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
69FFAF8022A99F1100801F3C /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 69FFAF7F22A99F1100801F3C /* AppDelegate.swift */; };
|
||||
69FFAF8222A99F1100801F3C /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 69FFAF8122A99F1100801F3C /* SceneDelegate.swift */; };
|
||||
69FFAF8422A99F1100801F3C /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 69FFAF8322A99F1100801F3C /* ContentView.swift */; };
|
||||
69FFAF8622A99F1200801F3C /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 69FFAF8522A99F1200801F3C /* Assets.xcassets */; };
|
||||
69FFAF8922A99F1200801F3C /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 69FFAF8822A99F1200801F3C /* Preview Assets.xcassets */; };
|
||||
69FFAF8C22A99F1200801F3C /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 69FFAF8A22A99F1200801F3C /* LaunchScreen.storyboard */; };
|
||||
69FFAF9822A9A12800801F3C /* APIService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 69FFAF9722A9A12800801F3C /* APIService.swift */; };
|
||||
69FFAF9B22A9A66200801F3C /* Movie.swift in Sources */ = {isa = PBXBuildFile; fileRef = 69FFAF9A22A9A66200801F3C /* Movie.swift */; };
|
||||
69FFAF9D22A9A6D500801F3C /* PaginatedResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 69FFAF9C22A9A6D500801F3C /* PaginatedResponse.swift */; };
|
||||
69FFAFA122A9A9F600801F3C /* Reducer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 69FFAFA022A9A9F600801F3C /* Reducer.swift */; };
|
||||
69FFAFA422A9AA2600801F3C /* Action.swift in Sources */ = {isa = PBXBuildFile; fileRef = 69FFAFA322A9AA2600801F3C /* Action.swift */; };
|
||||
69FFAFA622A9AA3500801F3C /* FluxState.swift in Sources */ = {isa = PBXBuildFile; fileRef = 69FFAFA522A9AA3500801F3C /* FluxState.swift */; };
|
||||
69FFAFA822A9AA4900801F3C /* AppState.swift in Sources */ = {isa = PBXBuildFile; fileRef = 69FFAFA722A9AA4900801F3C /* AppState.swift */; };
|
||||
69FFAFAA22A9AA6500801F3C /* MoviesState.swift in Sources */ = {isa = PBXBuildFile; fileRef = 69FFAFA922A9AA6500801F3C /* MoviesState.swift */; };
|
||||
69FFAFAC22A9AABB00801F3C /* MoviesStateReducer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 69FFAFAB22A9AABB00801F3C /* MoviesStateReducer.swift */; };
|
||||
69FFAFAE22A9AB1D00801F3C /* MoviesAction.swift in Sources */ = {isa = PBXBuildFile; fileRef = 69FFAFAD22A9AB1D00801F3C /* MoviesAction.swift */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
69FFAF7C22A99F1100801F3C /* MovieSwift.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MovieSwift.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
69FFAF7F22A99F1100801F3C /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
|
||||
69FFAF8122A99F1100801F3C /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = "<group>"; };
|
||||
69FFAF8322A99F1100801F3C /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = "<group>"; };
|
||||
69FFAF8522A99F1200801F3C /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
||||
69FFAF8822A99F1200801F3C /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = "<group>"; };
|
||||
69FFAF8B22A99F1200801F3C /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
|
||||
69FFAF8D22A99F1200801F3C /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
69FFAF9722A9A12800801F3C /* APIService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = APIService.swift; sourceTree = "<group>"; };
|
||||
69FFAF9A22A9A66200801F3C /* Movie.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Movie.swift; sourceTree = "<group>"; };
|
||||
69FFAF9C22A9A6D500801F3C /* PaginatedResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PaginatedResponse.swift; sourceTree = "<group>"; };
|
||||
69FFAFA022A9A9F600801F3C /* Reducer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Reducer.swift; sourceTree = "<group>"; };
|
||||
69FFAFA322A9AA2600801F3C /* Action.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Action.swift; sourceTree = "<group>"; };
|
||||
69FFAFA522A9AA3500801F3C /* FluxState.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FluxState.swift; sourceTree = "<group>"; };
|
||||
69FFAFA722A9AA4900801F3C /* AppState.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppState.swift; sourceTree = "<group>"; };
|
||||
69FFAFA922A9AA6500801F3C /* MoviesState.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MoviesState.swift; sourceTree = "<group>"; };
|
||||
69FFAFAB22A9AABB00801F3C /* MoviesStateReducer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MoviesStateReducer.swift; sourceTree = "<group>"; };
|
||||
69FFAFAD22A9AB1D00801F3C /* MoviesAction.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MoviesAction.swift; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
69FFAF7922A99F1100801F3C /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
69FFAF7322A99F1100801F3C = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
69FFAF7E22A99F1100801F3C /* MovieSwift */,
|
||||
69FFAF7D22A99F1100801F3C /* Products */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
69FFAF7D22A99F1100801F3C /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
69FFAF7C22A99F1100801F3C /* MovieSwift.app */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
69FFAF7E22A99F1100801F3C /* MovieSwift */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
69FFAF9322A9A0D800801F3C /* launch */,
|
||||
69FFAF9522A9A0E300801F3C /* flux */,
|
||||
69FFAF9622A9A11A00801F3C /* services */,
|
||||
69FFAF9422A9A0DF00801F3C /* views */,
|
||||
69FFAF8522A99F1200801F3C /* Assets.xcassets */,
|
||||
69FFAF8A22A99F1200801F3C /* LaunchScreen.storyboard */,
|
||||
69FFAF8D22A99F1200801F3C /* Info.plist */,
|
||||
69FFAF8722A99F1200801F3C /* Preview Content */,
|
||||
);
|
||||
path = MovieSwift;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
69FFAF8722A99F1200801F3C /* Preview Content */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
69FFAF8822A99F1200801F3C /* Preview Assets.xcassets */,
|
||||
);
|
||||
path = "Preview Content";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
69FFAF9322A9A0D800801F3C /* launch */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
69FFAF7F22A99F1100801F3C /* AppDelegate.swift */,
|
||||
69FFAF8122A99F1100801F3C /* SceneDelegate.swift */,
|
||||
);
|
||||
path = launch;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
69FFAF9422A9A0DF00801F3C /* views */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
69FFAF8322A99F1100801F3C /* ContentView.swift */,
|
||||
);
|
||||
path = views;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
69FFAF9522A9A0E300801F3C /* flux */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
69FFAFA222A9AA1E00801F3C /* actions */,
|
||||
69FFAF9F22A9A9E600801F3C /* reducers */,
|
||||
69FFAF9E22A9A9D400801F3C /* state */,
|
||||
69FFAF9922A9A1AE00801F3C /* models */,
|
||||
);
|
||||
path = flux;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
69FFAF9622A9A11A00801F3C /* services */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
69FFAF9722A9A12800801F3C /* APIService.swift */,
|
||||
);
|
||||
path = services;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
69FFAF9922A9A1AE00801F3C /* models */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
69FFAF9A22A9A66200801F3C /* Movie.swift */,
|
||||
69FFAF9C22A9A6D500801F3C /* PaginatedResponse.swift */,
|
||||
);
|
||||
path = models;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
69FFAF9E22A9A9D400801F3C /* state */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
69FFAFA522A9AA3500801F3C /* FluxState.swift */,
|
||||
69FFAFA722A9AA4900801F3C /* AppState.swift */,
|
||||
69FFAFA922A9AA6500801F3C /* MoviesState.swift */,
|
||||
);
|
||||
path = state;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
69FFAF9F22A9A9E600801F3C /* reducers */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
69FFAFA022A9A9F600801F3C /* Reducer.swift */,
|
||||
69FFAFAB22A9AABB00801F3C /* MoviesStateReducer.swift */,
|
||||
);
|
||||
path = reducers;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
69FFAFA222A9AA1E00801F3C /* actions */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
69FFAFA322A9AA2600801F3C /* Action.swift */,
|
||||
69FFAFAD22A9AB1D00801F3C /* MoviesAction.swift */,
|
||||
);
|
||||
path = actions;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
69FFAF7B22A99F1100801F3C /* MovieSwift */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 69FFAF9022A99F1200801F3C /* Build configuration list for PBXNativeTarget "MovieSwift" */;
|
||||
buildPhases = (
|
||||
69FFAF7822A99F1100801F3C /* Sources */,
|
||||
69FFAF7922A99F1100801F3C /* Frameworks */,
|
||||
69FFAF7A22A99F1100801F3C /* Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = MovieSwift;
|
||||
productName = MovieSwift;
|
||||
productReference = 69FFAF7C22A99F1100801F3C /* MovieSwift.app */;
|
||||
productType = "com.apple.product-type.application";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
|
||||
/* Begin PBXProject section */
|
||||
69FFAF7422A99F1100801F3C /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastSwiftUpdateCheck = 1100;
|
||||
LastUpgradeCheck = 1100;
|
||||
ORGANIZATIONNAME = "Thomas Ricouard";
|
||||
TargetAttributes = {
|
||||
69FFAF7B22A99F1100801F3C = {
|
||||
CreatedOnToolsVersion = 11.0;
|
||||
};
|
||||
};
|
||||
};
|
||||
buildConfigurationList = 69FFAF7722A99F1100801F3C /* Build configuration list for PBXProject "MovieSwift" */;
|
||||
compatibilityVersion = "Xcode 9.3";
|
||||
developmentRegion = en;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
en,
|
||||
Base,
|
||||
);
|
||||
mainGroup = 69FFAF7322A99F1100801F3C;
|
||||
productRefGroup = 69FFAF7D22A99F1100801F3C /* Products */;
|
||||
projectDirPath = "";
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
69FFAF7B22A99F1100801F3C /* MovieSwift */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXResourcesBuildPhase section */
|
||||
69FFAF7A22A99F1100801F3C /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
69FFAF8C22A99F1200801F3C /* LaunchScreen.storyboard in Resources */,
|
||||
69FFAF8922A99F1200801F3C /* Preview Assets.xcassets in Resources */,
|
||||
69FFAF8622A99F1200801F3C /* Assets.xcassets in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
69FFAF7822A99F1100801F3C /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
69FFAF8022A99F1100801F3C /* AppDelegate.swift in Sources */,
|
||||
69FFAFA822A9AA4900801F3C /* AppState.swift in Sources */,
|
||||
69FFAF8222A99F1100801F3C /* SceneDelegate.swift in Sources */,
|
||||
69FFAF9D22A9A6D500801F3C /* PaginatedResponse.swift in Sources */,
|
||||
69FFAF9822A9A12800801F3C /* APIService.swift in Sources */,
|
||||
69FFAFA122A9A9F600801F3C /* Reducer.swift in Sources */,
|
||||
69FFAFA422A9AA2600801F3C /* Action.swift in Sources */,
|
||||
69FFAF8422A99F1100801F3C /* ContentView.swift in Sources */,
|
||||
69FFAFA622A9AA3500801F3C /* FluxState.swift in Sources */,
|
||||
69FFAFAC22A9AABB00801F3C /* MoviesStateReducer.swift in Sources */,
|
||||
69FFAFAA22A9AA6500801F3C /* MoviesState.swift in Sources */,
|
||||
69FFAF9B22A9A66200801F3C /* Movie.swift in Sources */,
|
||||
69FFAFAE22A9AB1D00801F3C /* MoviesAction.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXVariantGroup section */
|
||||
69FFAF8A22A99F1200801F3C /* LaunchScreen.storyboard */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
69FFAF8B22A99F1200801F3C /* Base */,
|
||||
);
|
||||
name = LaunchScreen.storyboard;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXVariantGroup section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
69FFAF8E22A99F1200801F3C /* 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;
|
||||
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 = 13.0;
|
||||
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
|
||||
MTL_FAST_MATH = YES;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
SDKROOT = iphoneos;
|
||||
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
69FFAF8F22A99F1200801F3C /* 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;
|
||||
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 = 13.0;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
MTL_FAST_MATH = YES;
|
||||
SDKROOT = iphoneos;
|
||||
SWIFT_COMPILATION_MODE = wholemodule;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-O";
|
||||
VALIDATE_PRODUCT = YES;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
69FFAF9122A99F1200801F3C /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
DEVELOPMENT_ASSET_PATHS = "MovieSwift/Preview\\ Content";
|
||||
DEVELOPMENT_TEAM = Z6P74P6T99;
|
||||
ENABLE_PREVIEWS = YES;
|
||||
INFOPLIST_FILE = MovieSwift/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.thomasricouard.MovieSwift;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_VERSION = 5.0;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
69FFAF9222A99F1200801F3C /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
DEVELOPMENT_ASSET_PATHS = "MovieSwift/Preview\\ Content";
|
||||
DEVELOPMENT_TEAM = Z6P74P6T99;
|
||||
ENABLE_PREVIEWS = YES;
|
||||
INFOPLIST_FILE = MovieSwift/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.thomasricouard.MovieSwift;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_VERSION = 5.0;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
69FFAF7722A99F1100801F3C /* Build configuration list for PBXProject "MovieSwift" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
69FFAF8E22A99F1200801F3C /* Debug */,
|
||||
69FFAF8F22A99F1200801F3C /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
69FFAF9022A99F1200801F3C /* Build configuration list for PBXNativeTarget "MovieSwift" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
69FFAF9122A99F1200801F3C /* Debug */,
|
||||
69FFAF9222A99F1200801F3C /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
};
|
||||
rootObject = 69FFAF7422A99F1100801F3C /* Project object */;
|
||||
}
|
||||
7
Examples/Movie/MovieSwift/MovieSwift.xcodeproj/project.xcworkspace/contents.xcworkspacedata
generated
Executable file
7
Examples/Movie/MovieSwift/MovieSwift.xcodeproj/project.xcworkspace/contents.xcworkspacedata
generated
Executable file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Workspace
|
||||
version = "1.0">
|
||||
<FileRef
|
||||
location = "self:MovieSwift.xcodeproj">
|
||||
</FileRef>
|
||||
</Workspace>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>IDEDidComputeMac32BitWarning</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,98 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "20x20",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "20x20",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "29x29",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "29x29",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "40x40",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "40x40",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "60x60",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "60x60",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "20x20",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "20x20",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "29x29",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "29x29",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "40x40",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "40x40",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "76x76",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "76x76",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "83.5x83.5",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ios-marketing",
|
||||
"size" : "1024x1024",
|
||||
"scale" : "1x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
6
Examples/Movie/MovieSwift/MovieSwift/Assets.xcassets/Contents.json
Executable file
6
Examples/Movie/MovieSwift/MovieSwift/Assets.xcassets/Contents.json
Executable file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
25
Examples/Movie/MovieSwift/MovieSwift/Base.lproj/LaunchScreen.storyboard
Executable file
25
Examples/Movie/MovieSwift/MovieSwift/Base.lproj/LaunchScreen.storyboard
Executable file
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13122.16" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13104.12"/>
|
||||
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<scenes>
|
||||
<!--View Controller-->
|
||||
<scene sceneID="EHf-IW-A2E">
|
||||
<objects>
|
||||
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
|
||||
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<color key="backgroundColor" xcode11CocoaTouchSystemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
|
||||
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
|
||||
</view>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="53" y="375"/>
|
||||
</scene>
|
||||
</scenes>
|
||||
</document>
|
||||
62
Examples/Movie/MovieSwift/MovieSwift/Info.plist
Executable file
62
Examples/Movie/MovieSwift/MovieSwift/Info.plist
Executable file
@@ -0,0 +1,62 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>$(PRODUCT_NAME)</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
<key>LSRequiresIPhoneOS</key>
|
||||
<true/>
|
||||
<key>UIApplicationSceneManifest</key>
|
||||
<dict>
|
||||
<key>UIApplicationSupportsMultipleScenes</key>
|
||||
<false/>
|
||||
<key>UISceneConfigurations</key>
|
||||
<dict>
|
||||
<key>UIWindowSceneSessionRoleApplication</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>UILaunchStoryboardName</key>
|
||||
<string>LaunchScreen</string>
|
||||
<key>UISceneConfigurationName</key>
|
||||
<string>Default Configuration</string>
|
||||
<key>UISceneDelegateClassName</key>
|
||||
<string>$(PRODUCT_MODULE_NAME).SceneDelegate</string>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>UILaunchStoryboardName</key>
|
||||
<string>LaunchScreen</string>
|
||||
<key>UIRequiredDeviceCapabilities</key>
|
||||
<array>
|
||||
<string>armv7</string>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations~ipad</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationPortraitUpsideDown</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
13
Examples/Movie/MovieSwift/MovieSwift/flux/actions/Action.swift
Executable file
13
Examples/Movie/MovieSwift/MovieSwift/flux/actions/Action.swift
Executable file
@@ -0,0 +1,13 @@
|
||||
//
|
||||
// Action.swift
|
||||
// MovieSwift
|
||||
//
|
||||
// Created by Thomas Ricouard on 06/06/2019.
|
||||
// Copyright © 2019 Thomas Ricouard. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
protocol Action {
|
||||
|
||||
}
|
||||
29
Examples/Movie/MovieSwift/MovieSwift/flux/actions/MoviesAction.swift
Executable file
29
Examples/Movie/MovieSwift/MovieSwift/flux/actions/MoviesAction.swift
Executable file
@@ -0,0 +1,29 @@
|
||||
//
|
||||
// MoviesAction.swift
|
||||
// MovieSwift
|
||||
//
|
||||
// Created by Thomas Ricouard on 06/06/2019.
|
||||
// Copyright © 2019 Thomas Ricouard. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
struct MoviesActions {
|
||||
struct FetchPopular: Action {
|
||||
init() {
|
||||
APIService.shared.GET(endpoint: .popular, params: nil) {
|
||||
(result: Result<PaginatedResponse<Movie>, APIService.APIError>) in
|
||||
switch result {
|
||||
case let .success(response):
|
||||
store.dispatch(action: SetPopular(response: response))
|
||||
case .failure(_):
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct SetPopular: Action {
|
||||
let response: PaginatedResponse<Movie>
|
||||
}
|
||||
}
|
||||
14
Examples/Movie/MovieSwift/MovieSwift/flux/models/Movie.swift
Executable file
14
Examples/Movie/MovieSwift/MovieSwift/flux/models/Movie.swift
Executable file
@@ -0,0 +1,14 @@
|
||||
//
|
||||
// Movie.swift
|
||||
// MovieSwift
|
||||
//
|
||||
// Created by Thomas Ricouard on 06/06/2019.
|
||||
// Copyright © 2019 Thomas Ricouard. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
struct Movie: Codable {
|
||||
let id: Int
|
||||
let original_title: String
|
||||
}
|
||||
16
Examples/Movie/MovieSwift/MovieSwift/flux/models/PaginatedResponse.swift
Executable file
16
Examples/Movie/MovieSwift/MovieSwift/flux/models/PaginatedResponse.swift
Executable file
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// PaginatedResponse.swift
|
||||
// MovieSwift
|
||||
//
|
||||
// Created by Thomas Ricouard on 06/06/2019.
|
||||
// Copyright © 2019 Thomas Ricouard. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
struct PaginatedResponse<T: Codable>: Codable {
|
||||
let page: Int
|
||||
let total_results: Int
|
||||
let total_pages: Int
|
||||
let results: [T]
|
||||
}
|
||||
22
Examples/Movie/MovieSwift/MovieSwift/flux/reducers/MoviesStateReducer.swift
Executable file
22
Examples/Movie/MovieSwift/MovieSwift/flux/reducers/MoviesStateReducer.swift
Executable file
@@ -0,0 +1,22 @@
|
||||
//
|
||||
// MoviesStateReducer.swift
|
||||
// MovieSwift
|
||||
//
|
||||
// Created by Thomas Ricouard on 06/06/2019.
|
||||
// Copyright © 2019 Thomas Ricouard. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
struct MoviesStateReducer: Reducer {
|
||||
func reduce(state: MoviesState, action: Action) -> MoviesState {
|
||||
var state = state
|
||||
if let action = action as? MoviesActions.SetPopular {
|
||||
state.popular = action.response.results.map{ $0.id }
|
||||
for (_, value) in action.response.results.enumerated() {
|
||||
state.movies[value.id] = value
|
||||
}
|
||||
}
|
||||
return state
|
||||
}
|
||||
}
|
||||
14
Examples/Movie/MovieSwift/MovieSwift/flux/reducers/Reducer.swift
Executable file
14
Examples/Movie/MovieSwift/MovieSwift/flux/reducers/Reducer.swift
Executable file
@@ -0,0 +1,14 @@
|
||||
//
|
||||
// Reducer.swift
|
||||
// MovieSwift
|
||||
//
|
||||
// Created by Thomas Ricouard on 06/06/2019.
|
||||
// Copyright © 2019 Thomas Ricouard. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
protocol Reducer {
|
||||
associatedtype StateType: FluxState
|
||||
func reduce(state: StateType, action: Action) -> StateType
|
||||
}
|
||||
28
Examples/Movie/MovieSwift/MovieSwift/flux/state/AppState.swift
Executable file
28
Examples/Movie/MovieSwift/MovieSwift/flux/state/AppState.swift
Executable file
@@ -0,0 +1,28 @@
|
||||
//
|
||||
// AppState.swift
|
||||
// MovieSwift
|
||||
//
|
||||
// Created by Thomas Ricouard on 06/06/2019.
|
||||
// Copyright © 2019 Thomas Ricouard. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import SwiftUI
|
||||
import Combine
|
||||
|
||||
final class AppState: BindableObject {
|
||||
var didChange = PassthroughSubject<AppState, Never>()
|
||||
|
||||
var moviesState: MoviesState
|
||||
|
||||
init(moviesState: MoviesState = MoviesState()) {
|
||||
self.moviesState = moviesState
|
||||
}
|
||||
|
||||
func dispatch(action: Action) {
|
||||
moviesState = MoviesStateReducer().reduce(state: moviesState, action: action)
|
||||
didChange.send(self)
|
||||
}
|
||||
}
|
||||
|
||||
let store = AppState()
|
||||
13
Examples/Movie/MovieSwift/MovieSwift/flux/state/FluxState.swift
Executable file
13
Examples/Movie/MovieSwift/MovieSwift/flux/state/FluxState.swift
Executable file
@@ -0,0 +1,13 @@
|
||||
//
|
||||
// FluxState.swift
|
||||
// MovieSwift
|
||||
//
|
||||
// Created by Thomas Ricouard on 06/06/2019.
|
||||
// Copyright © 2019 Thomas Ricouard. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
protocol FluxState {
|
||||
|
||||
}
|
||||
14
Examples/Movie/MovieSwift/MovieSwift/flux/state/MoviesState.swift
Executable file
14
Examples/Movie/MovieSwift/MovieSwift/flux/state/MoviesState.swift
Executable file
@@ -0,0 +1,14 @@
|
||||
//
|
||||
// MoviesState.swift
|
||||
// MovieSwift
|
||||
//
|
||||
// Created by Thomas Ricouard on 06/06/2019.
|
||||
// Copyright © 2019 Thomas Ricouard. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
struct MoviesState: FluxState {
|
||||
var movies: [Int: Movie] = [:]
|
||||
var popular: [Int] = []
|
||||
}
|
||||
41
Examples/Movie/MovieSwift/MovieSwift/launch/AppDelegate.swift
Executable file
41
Examples/Movie/MovieSwift/MovieSwift/launch/AppDelegate.swift
Executable file
@@ -0,0 +1,41 @@
|
||||
//
|
||||
// AppDelegate.swift
|
||||
// MovieSwift
|
||||
//
|
||||
// Created by Thomas Ricouard on 06/06/2019.
|
||||
// Copyright © 2019 Thomas Ricouard. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
@UIApplicationMain
|
||||
class AppDelegate: UIResponder, UIApplicationDelegate {
|
||||
|
||||
|
||||
|
||||
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
|
||||
// Override point for customization after application launch.
|
||||
return true
|
||||
}
|
||||
|
||||
func applicationWillTerminate(_ application: UIApplication) {
|
||||
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
|
||||
}
|
||||
|
||||
// MARK: UISceneSession Lifecycle
|
||||
|
||||
func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {
|
||||
// Called when a new scene session is being created.
|
||||
// Use this method to select a configuration to create the new scene with.
|
||||
return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
|
||||
}
|
||||
|
||||
func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) {
|
||||
// Called when the user discards a scene session.
|
||||
// If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions.
|
||||
// Use this method to release any resources that were specific to the discarded scenes, as they will not return.
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
59
Examples/Movie/MovieSwift/MovieSwift/launch/SceneDelegate.swift
Executable file
59
Examples/Movie/MovieSwift/MovieSwift/launch/SceneDelegate.swift
Executable file
@@ -0,0 +1,59 @@
|
||||
//
|
||||
// SceneDelegate.swift
|
||||
// MovieSwift
|
||||
//
|
||||
// Created by Thomas Ricouard on 06/06/2019.
|
||||
// Copyright © 2019 Thomas Ricouard. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
import SwiftUI
|
||||
|
||||
class SceneDelegate: UIResponder, UIWindowSceneDelegate {
|
||||
|
||||
var window: UIWindow?
|
||||
|
||||
|
||||
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
|
||||
// Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`.
|
||||
// If using a storyboard, the `window` property will automatically be initialized and attached to the scene.
|
||||
// This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead).
|
||||
|
||||
// Use a UIHostingController as window root view controller
|
||||
let window = UIWindow(frame: UIScreen.main.bounds)
|
||||
window.rootViewController = UIHostingController(rootView: ContentView().environmentObject(store))
|
||||
self.window = window
|
||||
window.makeKeyAndVisible()
|
||||
}
|
||||
|
||||
func sceneDidDisconnect(_ scene: UIScene) {
|
||||
// Called as the scene is being released by the system.
|
||||
// This occurs shortly after the scene enters the background, or when its session is discarded.
|
||||
// Release any resources associated with this scene that can be re-created the next time the scene connects.
|
||||
// The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead).
|
||||
}
|
||||
|
||||
func sceneDidBecomeActive(_ scene: UIScene) {
|
||||
// Called when the scene has moved from an inactive state to an active state.
|
||||
// Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive.
|
||||
}
|
||||
|
||||
func sceneWillResignActive(_ scene: UIScene) {
|
||||
// Called when the scene will move from an active state to an inactive state.
|
||||
// This may occur due to temporary interruptions (ex. an incoming phone call).
|
||||
}
|
||||
|
||||
func sceneWillEnterForeground(_ scene: UIScene) {
|
||||
// Called as the scene transitions from the background to the foreground.
|
||||
// Use this method to undo the changes made on entering the background.
|
||||
}
|
||||
|
||||
func sceneDidEnterBackground(_ scene: UIScene) {
|
||||
// Called as the scene transitions from the foreground to the background.
|
||||
// Use this method to save data, release shared resources, and store enough scene-specific state information
|
||||
// to restore the scene back to its current state.
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
68
Examples/Movie/MovieSwift/MovieSwift/services/APIService.swift
Executable file
68
Examples/Movie/MovieSwift/MovieSwift/services/APIService.swift
Executable file
@@ -0,0 +1,68 @@
|
||||
//
|
||||
// APIService.swift
|
||||
// MovieSwift
|
||||
//
|
||||
// Created by Thomas Ricouard on 06/06/2019.
|
||||
// Copyright © 2019 Thomas Ricouard. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
struct APIService {
|
||||
let baseURL = URL(string: "https://api.themoviedb.org/3")!
|
||||
let apiKey = "1d9b898a212ea52e283351e521e17871"
|
||||
static let shared = APIService()
|
||||
let decoder = JSONDecoder()
|
||||
|
||||
enum APIError: Error {
|
||||
case noResponse
|
||||
case jsonDecodingError(error: Error)
|
||||
case networkError(error: Error)
|
||||
}
|
||||
|
||||
enum Endpoint {
|
||||
case popular
|
||||
|
||||
func path() -> String {
|
||||
switch self {
|
||||
case .popular:
|
||||
return "movie/popular"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func GET<T: Codable>(endpoint: Endpoint,
|
||||
params: [String: String]?,
|
||||
completionHandler: @escaping (Result<T, APIError>) -> Void) {
|
||||
let queryURL = baseURL.appendingPathComponent(endpoint.path())
|
||||
var components = URLComponents(url: queryURL, resolvingAgainstBaseURL: true)!
|
||||
components.queryItems = [
|
||||
URLQueryItem(name: "api_key", value: apiKey)
|
||||
]
|
||||
if let params = params {
|
||||
for (_, value) in params.enumerated() {
|
||||
components.queryItems?.append(URLQueryItem(name: value.key, value: value.value))
|
||||
}
|
||||
}
|
||||
var request = URLRequest(url: components.url!)
|
||||
request.httpMethod = "GET"
|
||||
let task = URLSession.shared.dataTask(with: request) { (data, response, error) in
|
||||
guard let data = data else {
|
||||
completionHandler(.failure(.noResponse))
|
||||
return
|
||||
}
|
||||
guard error == nil else {
|
||||
completionHandler(.failure(.networkError(error: error!)))
|
||||
return
|
||||
}
|
||||
do {
|
||||
let object = try self.decoder.decode(T.self, from: data)
|
||||
completionHandler(.success(object))
|
||||
} catch let error {
|
||||
completionHandler(.failure(.jsonDecodingError(error: error)))
|
||||
}
|
||||
}
|
||||
task.resume()
|
||||
}
|
||||
}
|
||||
|
||||
33
Examples/Movie/MovieSwift/MovieSwift/views/ContentView.swift
Executable file
33
Examples/Movie/MovieSwift/MovieSwift/views/ContentView.swift
Executable file
@@ -0,0 +1,33 @@
|
||||
//
|
||||
// ContentView.swift
|
||||
// MovieSwift
|
||||
//
|
||||
// Created by Thomas Ricouard on 06/06/2019.
|
||||
// Copyright © 2019 Thomas Ricouard. All rights reserved.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct ContentView : View {
|
||||
@EnvironmentObject var state: AppState
|
||||
|
||||
init() {
|
||||
store.dispatch(action: MoviesActions.FetchPopular())
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
List {
|
||||
ForEach(state.moviesState.popular) { id in
|
||||
Text(self.state.moviesState.movies[id]?.original_title ?? "No title")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
struct ContentView_Previews : PreviewProvider {
|
||||
static var previews: some View {
|
||||
ContentView()
|
||||
}
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user