From 4c5c746468d996612e172be88aaae48fa5727e7b Mon Sep 17 00:00:00 2001 From: Abdul Momen <abdulmomen130@gmail.com> Date: Wed, 22 Mar 2023 11:13:17 +0600 Subject: [PATCH] fixes maple project --- .../NativeNetwoking.xcodeproj/project.pbxproj | 12 ++++++++++-- Example/NativeNetwoking/PostsAPIClient.swift | 4 ++-- Example/NativeNetwoking/ViewController.swift | 7 +------ Example/Pods/Pods.xcodeproj/project.pbxproj | 18 +++++++++++++----- NativeNetwoking.podspec | 2 +- .../Protocols/GenericAPIClient.swift | 4 ++-- 6 files changed, 29 insertions(+), 18 deletions(-) diff --git a/Example/NativeNetwoking.xcodeproj/project.pbxproj b/Example/NativeNetwoking.xcodeproj/project.pbxproj index 150794f..3fabf3a 100644 --- a/Example/NativeNetwoking.xcodeproj/project.pbxproj +++ b/Example/NativeNetwoking.xcodeproj/project.pbxproj @@ -518,6 +518,7 @@ baseConfigurationReference = 693FF39B546997C1314ECC7B /* Pods-NativeNetwoking_Tests.debug.xcconfig */; buildSettings = { DEVELOPMENT_TEAM = YDN344UV2Z; + DRIVERKIT_DEPLOYMENT_TARGET = 19.0; FRAMEWORK_SEARCH_PATHS = ( "$(PLATFORM_DIR)/Developer/Library/Frameworks", "$(inherited)", @@ -527,13 +528,16 @@ "$(inherited)", ); INFOPLIST_FILE = Tests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 10.0; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 10.13; PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_SWIFT3_OBJC_INFERENCE = Default; SWIFT_VERSION = 4.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/NativeNetwoking_Example.app/NativeNetwoking_Example"; + TVOS_DEPLOYMENT_TARGET = 11.0; + WATCHOS_DEPLOYMENT_TARGET = 4.0; }; name = Debug; }; @@ -542,18 +546,22 @@ baseConfigurationReference = B707A924BE560436AB37A002 /* Pods-NativeNetwoking_Tests.release.xcconfig */; buildSettings = { DEVELOPMENT_TEAM = YDN344UV2Z; + DRIVERKIT_DEPLOYMENT_TARGET = 19.0; FRAMEWORK_SEARCH_PATHS = ( "$(PLATFORM_DIR)/Developer/Library/Frameworks", "$(inherited)", ); INFOPLIST_FILE = Tests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 10.0; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 10.13; PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_SWIFT3_OBJC_INFERENCE = Default; SWIFT_VERSION = 4.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/NativeNetwoking_Example.app/NativeNetwoking_Example"; + TVOS_DEPLOYMENT_TARGET = 11.0; + WATCHOS_DEPLOYMENT_TARGET = 4.0; }; name = Release; }; diff --git a/Example/NativeNetwoking/PostsAPIClient.swift b/Example/NativeNetwoking/PostsAPIClient.swift index c8f8a79..805b55d 100644 --- a/Example/NativeNetwoking/PostsAPIClient.swift +++ b/Example/NativeNetwoking/PostsAPIClient.swift @@ -18,8 +18,8 @@ private struct PostsEndPoint: EndPoint { } } -struct PostsAPIClient: GenericAPIClient { - static func fetchPosts(completion: @escaping (Result<[Post]?, DefaultErrorModel>) -> Void) { +struct PostsAPIClient: GenericAPIClient { + static func fetchPosts(completion: @escaping (Result<[Post]?, ErrorModel>) -> Void) { startRequest(with: PostsEndPoint(), completion: completion) } } diff --git a/Example/NativeNetwoking/ViewController.swift b/Example/NativeNetwoking/ViewController.swift index 5bd978b..091c4f4 100644 --- a/Example/NativeNetwoking/ViewController.swift +++ b/Example/NativeNetwoking/ViewController.swift @@ -51,11 +51,6 @@ extension ViewController: UITableViewDelegate, UITableViewDataSource { } struct Post: Codable { - let userID, ids: Int + let userId, id: Int let title, body: String - - enum CodingKeys: String, CodingKey { - case userID = "userId" - case ids, title, body - } } diff --git a/Example/Pods/Pods.xcodeproj/project.pbxproj b/Example/Pods/Pods.xcodeproj/project.pbxproj index c98c22b..7ba12c5 100644 --- a/Example/Pods/Pods.xcodeproj/project.pbxproj +++ b/Example/Pods/Pods.xcodeproj/project.pbxproj @@ -57,7 +57,7 @@ 73010CC983E3809BECEE5348DA1BB8C6 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.0.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; }; 7CB2767C4ABB63CFD21088C638DC7BBA /* NativeNetwoking-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "NativeNetwoking-prefix.pch"; sourceTree = "<group>"; }; 7FF2FF8CDF38341C51C3138694E4F1F9 /* Pods-NativeNetwoking_Example */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = "Pods-NativeNetwoking_Example"; path = Pods_NativeNetwoking_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 8D401E4203C3B2A084CF87571BFCFAB8 /* NativeNetwoking */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = NativeNetwoking; path = NativeNetwoking.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 8D401E4203C3B2A084CF87571BFCFAB8 /* NativeNetwoking.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = NativeNetwoking.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 90DD70FF4BA8369F52871A60C9B854A3 /* Pods-NativeNetwoking_Tests-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-NativeNetwoking_Tests-Info.plist"; sourceTree = "<group>"; }; 9218C1BB1AA984E1A73458ECDAED442E /* Pods-NativeNetwoking_Tests-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-NativeNetwoking_Tests-acknowledgements.plist"; sourceTree = "<group>"; }; 9D940727FF8FB9C785EB98E56350EF41 /* Podfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; indentWidth = 2; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; tabWidth = 2; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; @@ -168,7 +168,7 @@ 8C0BC9572BE98BD6CA42B2E6EEB46366 /* Products */ = { isa = PBXGroup; children = ( - 8D401E4203C3B2A084CF87571BFCFAB8 /* NativeNetwoking */, + 8D401E4203C3B2A084CF87571BFCFAB8 /* NativeNetwoking.framework */, 7FF2FF8CDF38341C51C3138694E4F1F9 /* Pods-NativeNetwoking_Example */, 480E74400454E1F8DBD3344F9727D98B /* Pods-NativeNetwoking_Tests */, ); @@ -336,7 +336,7 @@ ); name = NativeNetwoking; productName = NativeNetwoking; - productReference = 8D401E4203C3B2A084CF87571BFCFAB8 /* NativeNetwoking */; + productReference = 8D401E4203C3B2A084CF87571BFCFAB8 /* NativeNetwoking.framework */; productType = "com.apple.product-type.framework"; }; /* End PBXNativeTarget section */ @@ -450,14 +450,16 @@ "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; CURRENT_PROJECT_VERSION = 1; DEFINES_MODULE = YES; + DRIVERKIT_DEPLOYMENT_TARGET = 19.0; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; GCC_PREFIX_HEADER = "Target Support Files/NativeNetwoking/NativeNetwoking-prefix.pch"; INFOPLIST_FILE = "Target Support Files/NativeNetwoking/NativeNetwoking-Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 10.0; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 10.13; MODULEMAP_FILE = "Target Support Files/NativeNetwoking/NativeNetwoking.modulemap"; PRODUCT_MODULE_NAME = NativeNetwoking; PRODUCT_NAME = NativeNetwoking; @@ -466,9 +468,11 @@ SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; SWIFT_VERSION = 4.0; TARGETED_DEVICE_FAMILY = "1,2"; + TVOS_DEPLOYMENT_TARGET = 11.0; VALIDATE_PRODUCT = YES; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; + WATCHOS_DEPLOYMENT_TARGET = 4.0; }; name = Release; }; @@ -743,14 +747,16 @@ "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; CURRENT_PROJECT_VERSION = 1; DEFINES_MODULE = YES; + DRIVERKIT_DEPLOYMENT_TARGET = 19.0; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; GCC_PREFIX_HEADER = "Target Support Files/NativeNetwoking/NativeNetwoking-prefix.pch"; INFOPLIST_FILE = "Target Support Files/NativeNetwoking/NativeNetwoking-Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 10.0; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 10.13; MODULEMAP_FILE = "Target Support Files/NativeNetwoking/NativeNetwoking.modulemap"; PRODUCT_MODULE_NAME = NativeNetwoking; PRODUCT_NAME = NativeNetwoking; @@ -759,8 +765,10 @@ SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; SWIFT_VERSION = 4.0; TARGETED_DEVICE_FAMILY = "1,2"; + TVOS_DEPLOYMENT_TARGET = 11.0; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; + WATCHOS_DEPLOYMENT_TARGET = 4.0; }; name = Debug; }; diff --git a/NativeNetwoking.podspec b/NativeNetwoking.podspec index f29209e..57d7659 100644 --- a/NativeNetwoking.podspec +++ b/NativeNetwoking.podspec @@ -8,7 +8,7 @@ Pod::Spec.new do |s| s.author = { 'abmomen' => 'abdulmomen130@gmail.com' } s.source = { :git => 'https://github.com/abmomen/NativeNetwoking.git', :tag => s.version.to_s } - s.ios.deployment_target = '10.0' + s.ios.deployment_target = '8.0' s.source_files = 'NativeNetwoking/Classes/**/*' end diff --git a/NativeNetwoking/Classes/Networking/Protocols/GenericAPIClient.swift b/NativeNetwoking/Classes/Networking/Protocols/GenericAPIClient.swift index 73d0781..091c390 100644 --- a/NativeNetwoking/Classes/Networking/Protocols/GenericAPIClient.swift +++ b/NativeNetwoking/Classes/Networking/Protocols/GenericAPIClient.swift @@ -9,12 +9,12 @@ import Foundation public typealias ErrorModel = NetworkError<CustomErrorModel> -protocol GenericAPIClient { +public protocol GenericAPIClient { static func startRequest<T: Decodable>(with endPoint: EndPoint, decoder: JSONDecoder, completion: @escaping (Result<T, ErrorModel>) -> Void) } -extension GenericAPIClient { +public extension GenericAPIClient { static func startRequest<T: Decodable>(with endPoint: EndPoint, decoder: JSONDecoder = JSONDecoder(), completion: @escaping (Result<T, ErrorModel>) -> Void) {