Skip to content

Commit

Permalink
Merge pull request #86 from Electrode-iOS/swift5
Browse files Browse the repository at this point in the history
support Swift 5 and Xcode 10.2
  • Loading branch information
angelodipaolo authored Apr 11, 2019
2 parents 0b156f5 + df257da commit 9df3be3
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 27 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
language: objective-c
osx_image: xcode10.1
osx_image: xcode10.2
script:
- xcodebuild -scheme ELWebService -sdk iphonesimulator clean test -destination 'OS=12.1,name=iPhone XR' CODE_SIGNING_REQUIRED=NO
- xcodebuild -scheme ELWebService_static -sdk iphonesimulator clean build -destination 'OS=12.1,name=iPhone XR' CODE_SIGNING_REQUIRED=NO
- xcodebuild -scheme ELWebService -sdk iphonesimulator clean test -destination 'OS=12.2,name=iPhone ' CODE_SIGNING_REQUIRED=NO
- xcodebuild -scheme ELWebService_static -sdk iphonesimulator clean build -destination 'OS=12.2,name=iPhone ' CODE_SIGNING_REQUIRED=NO
39 changes: 20 additions & 19 deletions ELWebService.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -273,25 +273,29 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0720;
LastUpgradeCheck = 0930;
LastUpgradeCheck = 1020;
ORGANIZATIONNAME = WalmartLabs;
TargetAttributes = {
17088ED01C5010EA007ADE1B = {
CreatedOnToolsVersion = 7.2;
LastSwiftMigration = 0920;
LastSwiftMigration = 1020;
};
179C5C5D1AB079980047169F = {
CreatedOnToolsVersion = 6.3;
LastSwiftMigration = 0920;
LastSwiftMigration = 1020;
};
3E8CA4A120E587CB00CBDA69 = {
LastSwiftMigration = 1020;
};
};
};
buildConfigurationList = 179C5C581AB079980047169F /* Build configuration list for PBXProject "ELWebService" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 179C5C541AB079980047169F;
productRefGroup = 179C5C5F1AB079980047169F /* Products */;
Expand Down Expand Up @@ -407,8 +411,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "ELWebServiceTests/ELWebServiceTests-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
Expand All @@ -422,15 +425,15 @@
PRODUCT_BUNDLE_IDENTIFIER = com.electrode.ELWebServiceTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "ELWebServiceTests/ELWebServiceTests-Bridging-Header.h";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
};
name = Release;
};
179C5C721AB079980047169F /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
Expand Down Expand Up @@ -490,6 +493,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
Expand Down Expand Up @@ -554,8 +558,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.walmartlabs.ELWebService;
PRODUCT_NAME = ELWebService;
SKIP_INSTALL = YES;
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
Expand All @@ -575,8 +578,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.walmartlabs.ELWebService;
PRODUCT_NAME = ELWebService;
SKIP_INSTALL = YES;
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
};
name = Release;
};
Expand All @@ -594,7 +596,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.walmartlabs.ELWebService;
PRODUCT_NAME = ELWebService;
SKIP_INSTALL = YES;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
Expand All @@ -613,7 +615,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.walmartlabs.ELWebService;
PRODUCT_NAME = ELWebService;
SKIP_INSTALL = YES;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
};
name = QADeployment;
};
Expand All @@ -631,14 +633,15 @@
PRODUCT_BUNDLE_IDENTIFIER = com.walmartlabs.ELWebService;
PRODUCT_NAME = ELWebService;
SKIP_INSTALL = YES;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
};
name = Release;
};
DB5F6F7E1C77CEA50048EA81 /* QADeployment */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
Expand Down Expand Up @@ -711,8 +714,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.walmartlabs.ELWebService;
PRODUCT_NAME = ELWebService;
SKIP_INSTALL = YES;
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
};
name = QADeployment;
};
Expand All @@ -727,8 +729,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "ELWebServiceTests/ELWebServiceTests-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
};
name = QADeployment;
};
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ELWebService is an HTTP framework for Swift built on Foundation's `URLSession`.

## Requirements

ELWebService requires Swift 4 and Xcode 9.2.
ELWebService requires Swift 5 and Xcode 10.2.

## Installation

Expand Down
8 changes: 4 additions & 4 deletions Source/Core/Request.swift
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,10 @@ public struct Request {
The HTTP header fields of the request. Each key/value pair represents a
HTTP header field value using the key as the field name.
*/
internal(set) var headers = [String : String]()
var headers = [String : String]()

/// The cache policy of the request. See NSURLRequestCachePolicy.
internal(set) var cachePolicy = NSURLRequest.CachePolicy.useProtocolCachePolicy
var cachePolicy = NSURLRequest.CachePolicy.useProtocolCachePolicy

/// The type of parameter encoding to use when encoding request parameters.
public var parameterEncoding = ParameterEncoding.percent {
Expand All @@ -170,13 +170,13 @@ public struct Request {
}

/// The HTTP `Content-Type` header field value of the request.
internal(set) var contentType: String? {
var contentType: String? {
set { headers[Headers.contentType] = newValue }
get { return headers[Headers.contentType] }
}

/// The HTTP `User-Agent` header field value of the request.
internal(set) var userAgent: String? {
var userAgent: String? {
set { headers[Headers.userAgent] = newValue }
get { return headers[Headers.userAgent] }
}
Expand Down

0 comments on commit 9df3be3

Please sign in to comment.