Skip to content

Commit 1fffa1e

Browse files
authored
Merge pull request #42 from hyperoslo/fix/swift4
Update to Swift 4
2 parents 10c76b4 + b7eb1b3 commit 1fffa1e

File tree

14 files changed

+56
-46
lines changed

14 files changed

+56
-46
lines changed

.slather.yml

Lines changed: 0 additions & 4 deletions
This file was deleted.

.swift-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.0
1+
4.0

.travis.yml

Lines changed: 0 additions & 16 deletions
This file was deleted.

Cartfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
github "hyperoslo/Keychains" "1.0.0"
2-
github "auth0/JWTDecode.swift" "2.0.0"
1+
github "hyperoslo/Keychains" ~> 2.0
2+
github "auth0/JWTDecode.swift" ~> 2.0

Cartfile.resolved

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
github "auth0/JWTDecode.swift" "2.0.0"
2-
github "hyperoslo/Keychain" "1.0.0"
1+
github "auth0/JWTDecode.swift" "2.1.1"
2+
github "hyperoslo/Keychains" "2.0.0"

OhMyAuth.podspec

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Pod::Spec.new do |s|
22
s.name = "OhMyAuth"
33
s.summary = "Simple OAuth2 library with a support of multiple services."
4-
s.version = "1.2.0"
4+
s.version = "2.0.0"
55
s.homepage = "https://github.com/hyperoslo/OhMyAuth"
66
s.license = 'MIT'
77
s.author = { "Hyper Interaktiv AS" => "ios@hyper.no" }
@@ -11,7 +11,7 @@ Pod::Spec.new do |s|
1111
}
1212
s.social_media_url = 'https://twitter.com/hyperoslo'
1313

14-
s.ios.deployment_target = '8.0'
14+
s.ios.deployment_target = '9.0'
1515
s.osx.deployment_target = '10.11'
1616

1717
s.requires_arc = true
@@ -21,8 +21,8 @@ Pod::Spec.new do |s|
2121
s.ios.frameworks = 'UIKit', 'Foundation'
2222
s.osx.frameworks = 'Cocoa', 'Foundation'
2323

24-
s.dependency 'Keychains', '~> 1.0.0'
25-
s.dependency 'JWTDecode', '~> 2.0.0'
24+
s.dependency 'Keychains', '~> 2.0'
25+
s.dependency 'JWTDecode', '~> 2.0'
2626

27-
s.pod_target_xcconfig = { 'SWIFT_VERSION' => '3.0' }
27+
s.pod_target_xcconfig = { 'SWIFT_VERSION' => '4.0' }
2828
end

OhMyAuth.xcodeproj/project.pbxproj

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@
413413
isa = PBXProject;
414414
attributes = {
415415
LastSwiftUpdateCheck = 0720;
416-
LastUpgradeCheck = 0800;
416+
LastUpgradeCheck = 0900;
417417
ORGANIZATIONNAME = "Hyper Interaktiv AS";
418418
TargetAttributes = {
419419
D5B2E89E1C3A780C00C0327D = {
@@ -615,14 +615,20 @@
615615
CLANG_CXX_LIBRARY = "libc++";
616616
CLANG_ENABLE_MODULES = YES;
617617
CLANG_ENABLE_OBJC_ARC = YES;
618+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
618619
CLANG_WARN_BOOL_CONVERSION = YES;
620+
CLANG_WARN_COMMA = YES;
619621
CLANG_WARN_CONSTANT_CONVERSION = YES;
620622
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
621623
CLANG_WARN_EMPTY_BODY = YES;
622624
CLANG_WARN_ENUM_CONVERSION = YES;
623625
CLANG_WARN_INFINITE_RECURSION = YES;
624626
CLANG_WARN_INT_CONVERSION = YES;
627+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
628+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
625629
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
630+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
631+
CLANG_WARN_STRICT_PROTOTYPES = YES;
626632
CLANG_WARN_SUSPICIOUS_MOVE = YES;
627633
CLANG_WARN_UNREACHABLE_CODE = YES;
628634
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@@ -651,7 +657,7 @@
651657
ONLY_ACTIVE_ARCH = YES;
652658
SDKROOT = iphoneos;
653659
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
654-
SWIFT_VERSION = 3.0;
660+
SWIFT_VERSION = 4.0;
655661
TARGETED_DEVICE_FAMILY = "1,2";
656662
VERSIONING_SYSTEM = "apple-generic";
657663
VERSION_INFO_PREFIX = "";
@@ -666,14 +672,20 @@
666672
CLANG_CXX_LIBRARY = "libc++";
667673
CLANG_ENABLE_MODULES = YES;
668674
CLANG_ENABLE_OBJC_ARC = YES;
675+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
669676
CLANG_WARN_BOOL_CONVERSION = YES;
677+
CLANG_WARN_COMMA = YES;
670678
CLANG_WARN_CONSTANT_CONVERSION = YES;
671679
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
672680
CLANG_WARN_EMPTY_BODY = YES;
673681
CLANG_WARN_ENUM_CONVERSION = YES;
674682
CLANG_WARN_INFINITE_RECURSION = YES;
675683
CLANG_WARN_INT_CONVERSION = YES;
684+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
685+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
676686
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
687+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
688+
CLANG_WARN_STRICT_PROTOTYPES = YES;
677689
CLANG_WARN_SUSPICIOUS_MOVE = YES;
678690
CLANG_WARN_UNREACHABLE_CODE = YES;
679691
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@@ -695,7 +707,7 @@
695707
MTL_ENABLE_DEBUG_INFO = NO;
696708
SDKROOT = iphoneos;
697709
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
698-
SWIFT_VERSION = 3.0;
710+
SWIFT_VERSION = 4.0;
699711
TARGETED_DEVICE_FAMILY = "1,2";
700712
VALIDATE_PRODUCT = YES;
701713
VERSIONING_SYSTEM = "apple-generic";
@@ -763,7 +775,6 @@
763775
PRODUCT_BUNDLE_IDENTIFIER = no.hyper.OhMyAuthTests;
764776
PRODUCT_NAME = OhMyAuthTests;
765777
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
766-
SWIFT_VERSION = 3.0;
767778
};
768779
name = Debug;
769780
};
@@ -779,7 +790,6 @@
779790
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks $(FRAMEWORK_SEARCH_PATHS)";
780791
PRODUCT_BUNDLE_IDENTIFIER = no.hyper.OhMyAuthTests;
781792
PRODUCT_NAME = OhMyAuthTests;
782-
SWIFT_VERSION = 3.0;
783793
};
784794
name = Release;
785795
};
@@ -807,7 +817,6 @@
807817
SDKROOT = macosx;
808818
SKIP_INSTALL = YES;
809819
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
810-
SWIFT_VERSION = 3.0;
811820
};
812821
name = Debug;
813822
};
@@ -834,7 +843,6 @@
834843
PRODUCT_NAME = OhMyAuth;
835844
SDKROOT = macosx;
836845
SKIP_INSTALL = YES;
837-
SWIFT_VERSION = 3.0;
838846
};
839847
name = Release;
840848
};
@@ -855,7 +863,6 @@
855863
PRODUCT_NAME = OhMyAuthTests;
856864
SDKROOT = macosx;
857865
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
858-
SWIFT_VERSION = 3.0;
859866
};
860867
name = Debug;
861868
};
@@ -875,7 +882,6 @@
875882
PRODUCT_BUNDLE_IDENTIFIER = "no.hyper.OhMyAuth-MacTests";
876883
PRODUCT_NAME = OhMyAuthTests;
877884
SDKROOT = macosx;
878-
SWIFT_VERSION = 3.0;
879885
};
880886
name = Release;
881887
};

OhMyAuth.xcodeproj/xcshareddata/xcschemes/OhMyAuth-Mac.xcscheme

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0800"
3+
LastUpgradeVersion = "0900"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -26,6 +26,7 @@
2626
buildConfiguration = "Debug"
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29+
language = ""
2930
shouldUseLaunchSchemeArgsEnv = "YES">
3031
<Testables>
3132
<TestableReference
@@ -55,6 +56,7 @@
5556
buildConfiguration = "Debug"
5657
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
5758
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
59+
language = ""
5860
launchStyle = "0"
5961
useCustomWorkingDirectory = "NO"
6062
ignoresPersistentStateOnLaunch = "NO"

OhMyAuth.xcodeproj/xcshareddata/xcschemes/OhMyAuth-iOS.xcscheme

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0800"
3+
LastUpgradeVersion = "0900"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -26,6 +26,7 @@
2626
buildConfiguration = "Debug"
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29+
language = ""
2930
shouldUseLaunchSchemeArgsEnv = "YES">
3031
<Testables>
3132
<TestableReference
@@ -55,6 +56,7 @@
5556
buildConfiguration = "Debug"
5657
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
5758
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
59+
language = ""
5860
launchStyle = "0"
5961
useCustomWorkingDirectory = "NO"
6062
ignoresPersistentStateOnLaunch = "NO"

Sources/Shared/AuthService.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import Foundation
22

33
@objc open class AuthService: NSObject {
44

5-
public typealias Completion = (String?, NSError?) -> Void
5+
public typealias Completion = (String?, Error?) -> Void
66

77
open let name: String
88
open let config: AuthConfig
@@ -169,7 +169,7 @@ import Foundation
169169

170170
switch result {
171171
case .failure(let error):
172-
completion(nil, error as? NSError)
172+
completion(nil, error)
173173
case .success(let accessToken):
174174
completion(accessToken, nil)
175175
}

0 commit comments

Comments
 (0)