Skip to content

Commit

Permalink
Merge pull request #323 from auth0/feature-update-xcode-8
Browse files Browse the repository at this point in the history
Update to Xcode 8 & Swift 2.3
  • Loading branch information
hzalaz authored Sep 18, 2016
2 parents 7983c96 + 603f41e commit 86734d1
Show file tree
Hide file tree
Showing 12 changed files with 40 additions and 22 deletions.
1 change: 1 addition & 0 deletions .swift-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.3
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
reference: http://www.objc.io/issue-6/travis-ci.html
language: objective-c
osx_image: xcode7.3
osx_image: xcode8
before_install: true
install: true
script:
Expand All @@ -14,7 +14,7 @@ branches:
- v2
env:
matrix:
- SCHEME="Lock" CARTHAGE_BUILD_PLATFORM="iOS" IOS_DESTINATION_VERSION="9.3"
- SCHEME="Lock" CARTHAGE_BUILD_PLATFORM="iOS" IOS_DESTINATION_VERSION="10.0"
global:
- secure: hU2sg0N7L2hEAXzmssJRyVGLm1cHKDwuZEE1BQy6y+9jo88926DSTZpw0uLs5h3tHWMctDt/7hoXe9D93oUQowNRaoy6Y/k34VD3Wzfbl2Dht/xZ4M2fgFwy8AYxI9Px3zLmQOewLCsAdFvoLs1rGuRcHy77RH6wtSCMJG/MVng=
after_success:
Expand Down
2 changes: 1 addition & 1 deletion Cartfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
github "auth0/Auth0.swift" "1.0.0-rc.2"
github "auth0/Auth0.swift" "v1@swift-2.3"
2 changes: 1 addition & 1 deletion Cartfile.private
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
github "Quick/Quick" ~> 0.9
github "Quick/Nimble" ~> 4.0
github "AliSoftware/OHHTTPStubs" ~> 5.0
github "emaloney/CleanroomLogger" "2.1.4"
github "emaloney/CleanroomLogger" "2.2.0"
4 changes: 2 additions & 2 deletions Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
github "auth0/Auth0.swift" "1.0.0-rc.2"
github "auth0/Auth0.swift" "a91d2d29adadc698d2288c65559f161a37537c05"
github "emaloney/CleanroomASL" "1.5.0"
github "Quick/Nimble" "v4.1.0"
github "AliSoftware/OHHTTPStubs" "5.2.1"
github "Quick/Quick" "v0.9.3"
github "emaloney/CleanroomLogger" "2.1.4"
github "emaloney/CleanroomLogger" "2.2.0"
22 changes: 20 additions & 2 deletions Lock.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
5F99AA881D1B0E2500D27842 /* Layout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5F99AA871D1B0E2500D27842 /* Layout.swift */; };
5F99AA8A1D1B360C00D27842 /* PrimaryButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5F99AA891D1B360C00D27842 /* PrimaryButton.swift */; };
5F99AA8C1D1B3F1300D27842 /* InputField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5F99AA8B1D1B3F1300D27842 /* InputField.swift */; };
5F99AA8E1D1B4BFA00D27842 /* Lock.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 5FEAE1C61D1A5154005C0028 /* Lock.framework */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
5F99AA8E1D1B4BFA00D27842 /* Lock.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 5FEAE1C61D1A5154005C0028 /* Lock.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
5F99AA901D1B9E7100D27842 /* DatabaseModeSwitcher.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5F99AA8F1D1B9E7100D27842 /* DatabaseModeSwitcher.swift */; };
5F99AA921D1BA5CA00D27842 /* DatabaseConstants.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5F99AA911D1BA5CA00D27842 /* DatabaseConstants.swift */; };
5F99AA941D1BABFC00D27842 /* SecondaryButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5F99AA931D1BABFC00D27842 /* SecondaryButton.swift */; };
Expand Down Expand Up @@ -751,17 +751,20 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0730;
LastUpgradeCheck = 0730;
LastUpgradeCheck = 0800;
ORGANIZATIONNAME = Auth0;
TargetAttributes = {
5FEADCF31D1A7EBC0032D810 = {
CreatedOnToolsVersion = 7.3.1;
LastSwiftMigration = 0800;
};
5FEAE1C51D1A5154005C0028 = {
CreatedOnToolsVersion = 7.3.1;
LastSwiftMigration = 0800;
};
5FEAE1CF1D1A5154005C0028 = {
CreatedOnToolsVersion = 7.3.1;
LastSwiftMigration = 0800;
TestTargetID = 5FEADCF31D1A7EBC0032D810;
};
5FF1FA311D4C12DF00158CD1 = {
Expand Down Expand Up @@ -1056,6 +1059,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.auth0.Lock;
PRODUCT_NAME = "$(TARGET_NAME)";
REEXPORTED_LIBRARY_PATHS = "";
SWIFT_VERSION = 2.3;
};
name = Debug;
};
Expand All @@ -1073,6 +1077,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.auth0.Lock;
PRODUCT_NAME = "$(TARGET_NAME)";
REEXPORTED_LIBRARY_PATHS = "";
SWIFT_VERSION = 2.3;
};
name = Release;
};
Expand All @@ -1090,8 +1095,10 @@
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_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
Expand Down Expand Up @@ -1139,8 +1146,10 @@
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_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
Expand All @@ -1160,6 +1169,7 @@
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
VERSIONING_SYSTEM = "apple-generic";
Expand All @@ -1171,6 +1181,7 @@
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ENABLE_MODULES = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
Expand All @@ -1187,13 +1198,15 @@
PRODUCT_NAME = Lock;
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 2.3;
};
name = Debug;
};
5FEAE1DC1D1A5154005C0028 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ENABLE_MODULES = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
Expand All @@ -1209,6 +1222,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.auth0.ios.Lock;
PRODUCT_NAME = Lock;
SKIP_INSTALL = YES;
SWIFT_VERSION = 2.3;
};
name = Release;
};
Expand All @@ -1223,6 +1237,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.auth0.LockTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 2.3;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/LockApp.app/LockApp";
};
name = Debug;
Expand All @@ -1238,13 +1253,15 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.auth0.LockTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 2.3;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/LockApp.app/LockApp";
};
name = Release;
};
5FF1FA371D4C12DF00158CD1 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
Expand All @@ -1261,6 +1278,7 @@
5FF1FA381D4C12DF00158CD1 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
Expand Down
2 changes: 1 addition & 1 deletion Lock.xcodeproj/xcshareddata/xcschemes/Lock.xcscheme
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0730"
LastUpgradeVersion = "0800"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
4 changes: 2 additions & 2 deletions Lock/DatabaseInteractor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ struct DatabaseInteractor: DatabaseAuthenticatable, DatabaseUserCreator, Loggabl

guard let password = self.password where self.validPassword else { return callback(.NonValidInput) }
guard let databaseName = self.connections.database?.name else { return callback(.NoDatabaseConnection) }

self.authentication
.login(
usernameOrEmail: identifier,
Expand Down Expand Up @@ -211,4 +211,4 @@ struct DatabaseInteractor: DatabaseAuthenticatable, DatabaseUserCreator, Loggabl
self.onAuthentication(credentials)
}
}
}
}
6 changes: 3 additions & 3 deletions Lock/Lock.swift
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ private func telemetryFor(authenticaction authentication: Authentication, webAut
// let bundle = _BundleHack.bundle
// let version = bundle.infoDictionary?["CFBundleShortVersionString"] as? String ?? "2.0.0-alpha.0"
let version = "2.0.0-beta.1"
authentication.using(inLibrary: name, version: version)
webAuth.using(inLibrary: name, version: version)
authentication.using(in: name, version: version)
webAuth.using(in: name, version: version)
return (authentication, webAuth)
}
}
3 changes: 1 addition & 2 deletions Lock/MultifactorInteractor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ struct MultifactorInteractor: MultifactorAuthenticatable {
guard let password = self.user.password where self.user.validPassword else { return callback(.NonValidInput) }
guard let code = self.code where self.validCode else { return callback(.NonValidInput) }
let database = self.connection.name

self.authentication
.login(usernameOrEmail: identifier, password: password, multifactorCode: code, connection: database)
.start { result in
Expand All @@ -81,4 +80,4 @@ struct MultifactorInteractor: MultifactorAuthenticatable {
}

}
}
}
6 changes: 3 additions & 3 deletions Lock/OptionBuildable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public extension OptionBuildable {
/// ToS URL. By default is Auth0's
var termsOfService: String {
get {
return self.termsOfServiceURL.absoluteString
return self.termsOfServiceURL.absoluteString! // FIXME: Better handling
}
set {
guard let url = NSURL(string: newValue) else { return } // FIXME: log error
Expand All @@ -92,11 +92,11 @@ public extension OptionBuildable {
/// Privacy Policy URL. By default is Auth0's
var privacyPolicy: String {
get {
return self.privacyPolicyURL.absoluteString
return self.privacyPolicyURL.absoluteString! // FIXME: Better handling
}
set {
guard let url = NSURL(string: newValue) else { return } // FIXME: log error
self.privacyPolicyURL = url
}
}
}
}
6 changes: 3 additions & 3 deletions Lock/Resources.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ func image(named name: String, compatibleWithTraitCollection traitCollection: UI
return UIImage(named: name, inBundle: bundleForLock(), compatibleWithTraitCollection: traitCollection)
}

func image(withColor color: UIColor) -> UIImage {
func image(withColor color: UIColor) -> UIImage? {
let rect = CGRect(x: 0, y: 0, width: 1, height: 1)
UIGraphicsBeginImageContext(rect.size)
let context = UIGraphicsGetCurrentContext()
guard let context = UIGraphicsGetCurrentContext() else { return nil }
CGContextSetFillColorWithColor(context, color.CGColor)

CGContextFillRect(context, rect)
Expand All @@ -56,4 +56,4 @@ func lightSystemFont(size size: CGFloat) -> UIFont {

func regularSystemFont(size size: CGFloat) -> UIFont {
return UIFont.systemFontOfSize(size, weight: UIFontWeightRegular)
}
}

0 comments on commit 86734d1

Please sign in to comment.