Skip to content
Permalink
Browse files

Compile fixes for swift 3.2

  • Loading branch information...
Michael Gray
Michael Gray committed Jun 13, 2017
1 parent e0a1a3b commit c76447e3e16834e81d3b0cdbb9ffa90d3ada49a1
@@ -14,30 +14,30 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?


func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
return true
}

func applicationWillResignActive(application: UIApplication) {
func applicationWillResignActive(_ application: UIApplication) {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
}

func applicationDidEnterBackground(application: UIApplication) {
func applicationDidEnterBackground(_ application: UIApplication) {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}

func applicationWillEnterForeground(application: UIApplication) {
func applicationWillEnterForeground(_ application: UIApplication) {
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
}

func applicationDidBecomeActive(application: UIApplication) {
func applicationDidBecomeActive(_ application: UIApplication) {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}

func applicationWillTerminate(application: UIApplication) {
func applicationWillTerminate(_ application: UIApplication) {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}

@@ -130,6 +130,13 @@
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
0D5203591EF078AF00245A0C /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 0DA41FA51ADAFE3D00B58B0B /* Project object */;
proxyType = 1;
remoteGlobalIDString = 0DDE325F1B38BD27007C39D9;
remoteInfo = "FutureKit iOS Testing App";
};
0DBB33071D0F919C0092BF7B /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 0DA41FA51ADAFE3D00B58B0B /* Project object */;
@@ -698,6 +705,7 @@
);
dependencies = (
0DEA1BF21AE3116A000E126F /* PBXTargetDependency */,
0D52035A1EF078AF00245A0C /* PBXTargetDependency */,
);
name = "FutureKit iOS Tests";
productName = "FutureKit iOS Tests";
@@ -729,7 +737,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0730;
LastUpgradeCheck = 0800;
LastUpgradeCheck = 0900;
ORGANIZATIONNAME = "Michael Gray";
TargetAttributes = {
0DBB32EE1D0F91640092BF7B = {
@@ -755,7 +763,9 @@
};
0DEA1B901AE30853000E126F = {
CreatedOnToolsVersion = 6.3;
DevelopmentTeam = AUXUTTBC4T;
LastSwiftMigration = 0800;
ProvisioningStyle = Automatic;
};
0DEA1BAE1AE30872000E126F = {
CreatedOnToolsVersion = 6.3;
@@ -765,6 +775,7 @@
CreatedOnToolsVersion = 6.3;
DevelopmentTeam = AUXUTTBC4T;
LastSwiftMigration = 0800;
TestTargetID = 0DDE325F1B38BD27007C39D9;
};
0DEA1BFE1AE313DD000E126F = {
CreatedOnToolsVersion = 6.3;
@@ -1042,6 +1053,11 @@
/* End PBXSourcesBuildPhase section */

/* Begin PBXTargetDependency section */
0D52035A1EF078AF00245A0C /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 0DDE325F1B38BD27007C39D9 /* FutureKit iOS Testing App */;
targetProxy = 0D5203591EF078AF00245A0C /* PBXContainerItemProxy */;
};
0DBB33081D0F919C0092BF7B /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 0DBB32FB1D0F919C0092BF7B /* FutureKit tvOS */;
@@ -1092,14 +1108,20 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = 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_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@@ -1124,7 +1146,8 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MACOSX_DEPLOYMENT_TARGET = 10.10;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
@@ -1143,14 +1166,20 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = 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_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@@ -1168,7 +1197,8 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MACOSX_DEPLOYMENT_TARGET = 10.10;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
@@ -1395,8 +1425,10 @@
buildSettings = {
APPLICATION_EXTENSION_API_ONLY = NO;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = AUXUTTBC4T;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
@@ -1406,10 +1438,11 @@
);
INFOPLIST_FILE = FutureKit/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "org.futurekit.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = FutureKit;
PROVISIONING_PROFILE_SPECIFIER = "";
SKIP_INSTALL = YES;
SWIFT_VERSION = 3.0;
};
@@ -1420,17 +1453,20 @@
buildSettings = {
APPLICATION_EXTENSION_API_ONLY = NO;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = AUXUTTBC4T;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = FutureKit/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "org.futurekit.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = FutureKit;
PROVISIONING_PROFILE_SPECIFIER = "";
SKIP_INSTALL = YES;
SWIFT_DISABLE_SAFETY_CHECKS = YES;
SWIFT_VERSION = 3.0;
@@ -1505,6 +1541,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "FutureKitTests/FutureKit iOS Tests-Bridging-Header.h";
SWIFT_VERSION = 3.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/FutureKit iOS Testing App.app/FutureKit iOS Testing App";
};
name = Debug;
};
@@ -1523,6 +1560,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "FutureKitTests/FutureKit iOS Tests-Bridging-Header.h";
SWIFT_VERSION = 3.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/FutureKit iOS Testing App.app/FutureKit iOS Testing App";
};
name = Release;
};
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0800"
LastUpgradeVersion = "0900"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0800"
LastUpgradeVersion = "0900"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -26,8 +26,8 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
enableAddressSanitizer = "YES">
enableAddressSanitizer = "YES"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0800"
LastUpgradeVersion = "0900"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0800"
LastUpgradeVersion = "0900"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -465,7 +465,7 @@ public extension CompletionType {
- returns: a new result of type Completion<S?>
*/
public func mapAsOptional<O : OptionalProtocol>() -> Completion<O.Wrapped?> {
public func mapAsOptional<O : OptionalProtocol>(type:O.Type) -> Completion<O.Wrapped?> {

return self.map { v -> O.Wrapped? in
return v as? O.Wrapped
@@ -12,7 +12,7 @@ import Foundation
//
// * a protocol to extend ErrorTypes that might ACTUALLY be cancellations!
// If you are returning
public protocol ErrorTypeMightBeCancellation : Error {
public protocol ErrorTypeMightBeCancellation: Error {

// should return true if the Error value is actually a cancellation
var isCancellation : Bool { get }
@@ -75,19 +75,30 @@ public extension NSErrorType {

public extension Error {
var isNSError : Bool {
return ((self as? NSErrorType) != nil)
return (Self.self is NSErrorType.Type)
}

public var testForCancellation : Bool {
return (self as? ErrorTypeMightBeCancellation)?.isCancellation ?? false
if Self.self is ErrorTypeMightBeCancellation.Type {
return (self as ErrorTypeMightBeCancellation).isCancellation
}
return false;
}


func toResult<T>() -> FutureResult<T> {
return (self as? ErrorTypeMightBeCancellation)?.toFutureResult() ?? .fail(self)
if Self.self is ErrorTypeMightBeCancellation.Type {
let errorType = self as ErrorTypeMightBeCancellation & Error
return errorType.toFutureResult()
}
return .fail(self)
}

func toCompletion<T>() -> Completion<T> {
return (self as? ErrorTypeMightBeCancellation)?.toFutureCompletion() ?? .fail(self)
if Self.self is ErrorTypeMightBeCancellation.Type {
let errorType = self as ErrorTypeMightBeCancellation & Error
return errorType.toFutureCompletion()
}
return .fail(self)
}

}
@@ -795,20 +795,14 @@ public enum Executor {
return block
case .stackCheckingImmediate:
let b = { (t:T) -> Void in
var currentDepth : NSNumber
let threadDict = Thread.current.threadDictionary
if let c = threadDict[GLOBAL_PARMS.STACK_CHECKING_PROPERTY] as? NSNumber {
currentDepth = c
}
else {
currentDepth = 0
}
if (currentDepth.intValue > GLOBAL_PARMS.STACK_CHECKING_MAX_DEPTH) {
let currentDepth = (threadDict[GLOBAL_PARMS.STACK_CHECKING_PROPERTY] as? Int32) ?? 0;
if (currentDepth > GLOBAL_PARMS.STACK_CHECKING_MAX_DEPTH) {
let b = Executor.AsyncExecutor.callbackBlockFor(block)
b(t)
}
else {
let newDepth = NSNumber(value: currentDepth.intValue+1 as Int32)
let newDepth = currentDepth + 1;
threadDict[GLOBAL_PARMS.STACK_CHECKING_PROPERTY] = newDepth
block(t)
threadDict[GLOBAL_PARMS.STACK_CHECKING_PROPERTY] = currentDepth
Oops, something went wrong.

0 comments on commit c76447e

Please sign in to comment.
You can’t perform that action at this time.