Skip to content

Commit

Permalink
fixes maple project
Browse files Browse the repository at this point in the history
  • Loading branch information
abmomen committed Mar 22, 2023
1 parent 5659951 commit 4c5c746
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 18 deletions.
12 changes: 10 additions & 2 deletions Example/NativeNetwoking.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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)",
Expand All @@ -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;
};
Expand All @@ -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;
};
Expand Down
4 changes: 2 additions & 2 deletions Example/NativeNetwoking/PostsAPIClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
7 changes: 1 addition & 6 deletions Example/NativeNetwoking/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
18 changes: 13 additions & 5 deletions Example/Pods/Pods.xcodeproj/project.pbxproj

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion NativeNetwoking.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Pod::Spec.new do |s|
s.author = { 'abmomen' => '[email protected]' }
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
Original file line number Diff line number Diff line change
Expand Up @@ -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) {

Expand Down

0 comments on commit 4c5c746

Please sign in to comment.