Skip to content

Commit

Permalink
Update to Swift 5.0 (#81)
Browse files Browse the repository at this point in the history
* [Project] Update Swift language version to 5.0

* [Misc] Remove redundant public access modifiers

* [Misc] Update .swift-version file to 5.0

* [Misc] Update .travis.yml to use Xcode 10.2

* [Pods] Update podspec to use Swift 5.0

* [Misc] Update .travis.yml to use iOS 12.2
  • Loading branch information
theblixguy authored Apr 3, 2019
1 parent 6bd587c commit 4a47549
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 35 deletions.
2 changes: 1 addition & 1 deletion .swift-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.2
5.0
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
os:
- osx
language: generic
osx_image: xcode10
osx_image: xcode10.2
script:
# - xcrun instruments -t 'Blank' -l 10 -w "iPhone 6s (10.3)"
- xcodebuild -scheme Example -configuration Debug -sdk iphonesimulator12.0 -destination "OS=12.0,name=iPhone 6s" build
- xcodebuild -scheme TABResourceLoader -configuration Debug -sdk iphonesimulator12.0 -destination "OS=12.0,name=iPhone 6s" test -enableCodeCoverage YES
- xcodebuild -scheme Example -configuration Debug -sdk iphonesimulator12.2 -destination "OS=12.2,name=iPhone Xs" build
- xcodebuild -scheme TABResourceLoader -configuration Debug -sdk iphonesimulator12.2 -destination "OS=12.2,name=iPhone Xs" test -enableCodeCoverage YES
after_success:
- bash <(curl -s https://codecov.io/bash)
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import Foundation

public extension CharacterSet {
public static var improvedUrlQueryAllowed: CharacterSet {
static var improvedUrlQueryAllowed: CharacterSet {
var characterSet = CharacterSet.urlQueryAllowed
characterSet.remove("&")
characterSet.remove("=")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,16 @@ public extension NetworkResourceType {

// MARK: Public properties

public var httpRequestMethod: HTTPMethod { return .get }
public var httpHeaderFields: [String: String]? { return [:] }
public var jsonBody: Any? { return nil }
public var queryItems: [URLQueryItem]? { return nil }
public var requestTimeoutInterval: TimeInterval? { return nil }
public var urlQueryAllowedCharacterSet: CharacterSet { return .improvedUrlQueryAllowed }
var httpRequestMethod: HTTPMethod { return .get }
var httpHeaderFields: [String: String]? { return [:] }
var jsonBody: Any? { return nil }
var queryItems: [URLQueryItem]? { return nil }
var requestTimeoutInterval: TimeInterval? { return nil }
var urlQueryAllowedCharacterSet: CharacterSet { return .improvedUrlQueryAllowed }

// MARK: Public functions

public func urlRequest() -> URLRequest? {
func urlRequest() -> URLRequest? {
guard let urlComponents = createURLComponents(), let urlFromComponents = urlComponents.url else {
return nil
}
Expand Down
4 changes: 2 additions & 2 deletions TABResourceLoader.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |spec|
spec.name = 'TABResourceLoader'
spec.homepage = 'https://github.com/theappbusiness/TABResourceLoader'
spec.version = '8.1.0'
spec.version = '8.2.0'
spec.license = { :type => 'MIT' }
spec.authors = { 'Luciano Marisi' => '[email protected]' }
spec.summary = 'Framework for loading resources from a network service'
Expand All @@ -11,5 +11,5 @@ Pod::Spec.new do |spec|
}
spec.source_files = 'Sources/**/*.swift'
spec.ios.deployment_target = '8.0'
spec.swift_version = '4.2'
spec.swift_version = '5.0'
end
29 changes: 16 additions & 13 deletions TABResourceLoader.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -606,16 +606,16 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0800;
LastUpgradeCheck = 0900;
LastUpgradeCheck = 1020;
ORGANIZATIONNAME = "Luciano Marisi";
TargetAttributes = {
4F079CCE1D84559100D08DA0 = {
CreatedOnToolsVersion = 7.3.1;
LastSwiftMigration = 0900;
LastSwiftMigration = 1020;
};
4F079CD81D84559200D08DA0 = {
CreatedOnToolsVersion = 7.3.1;
LastSwiftMigration = "";
LastSwiftMigration = 1020;
};
4F8D1FB91D8DFFD30099DD9A = {
CreatedOnToolsVersion = 8.0;
Expand All @@ -628,6 +628,7 @@
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
English,
en,
Base,
);
Expand Down Expand Up @@ -828,12 +829,14 @@
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_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;
Expand Down Expand Up @@ -866,6 +869,7 @@
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
Expand All @@ -885,12 +889,14 @@
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_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;
Expand All @@ -916,6 +922,7 @@
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
VERSIONING_SYSTEM = "apple-generic";
Expand All @@ -937,9 +944,8 @@
PRODUCT_BUNDLE_IDENTIFIER = com.lucianomarisi.TABResourceLoader;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_TREAT_WARNINGS_AS_ERRORS = YES;
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
Expand All @@ -957,9 +963,8 @@
PRODUCT_BUNDLE_IDENTIFIER = com.lucianomarisi.TABResourceLoader;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_TREAT_WARNINGS_AS_ERRORS = YES;
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
};
name = Release;
};
Expand All @@ -970,8 +975,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.lucianomarisi.TABResourceLoaderTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
Expand All @@ -982,8 +986,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.lucianomarisi.TABResourceLoaderTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
};
name = Release;
};
Expand All @@ -1000,7 +1003,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.lucianomarisi.Example;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
Expand All @@ -1016,7 +1019,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.lucianomarisi.Example;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
};
name = Release;
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0900"
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand All @@ -26,7 +26,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
Expand All @@ -46,7 +45,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0900"
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand All @@ -26,9 +26,8 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES"
codeCoverageEnabled = "YES">
codeCoverageEnabled = "YES"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
Expand Down Expand Up @@ -57,7 +56,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
Expand Down

0 comments on commit 4a47549

Please sign in to comment.