Skip to content
Permalink
Browse files

xcode 9 fixes

  • Loading branch information...
mishagray committed Aug 9, 2017
1 parent 1cc6d7b commit 6c2968d14bfb6b149b515439b6e2908b5a100413
@@ -1228,7 +1228,7 @@
PRODUCT_NAME = FutureKit;
SDKROOT = watchos;
SKIP_INSTALL = YES;
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 4.0;
TARGETED_DEVICE_FAMILY = 4;
WATCHOS_DEPLOYMENT_TARGET = 2.0;
};
@@ -1251,7 +1251,7 @@
PRODUCT_NAME = FutureKit;
SDKROOT = watchos;
SKIP_INSTALL = YES;
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 4.0;
TARGETED_DEVICE_FAMILY = 4;
WATCHOS_DEPLOYMENT_TARGET = 2.0;
};
@@ -1275,7 +1275,7 @@
PRODUCT_NAME = FutureKit;
SDKROOT = appletvos;
SKIP_INSTALL = YES;
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 4.0;
TARGETED_DEVICE_FAMILY = 3;
TVOS_DEPLOYMENT_TARGET = 9.0;
};
@@ -1298,7 +1298,7 @@
PRODUCT_NAME = FutureKit;
SDKROOT = appletvos;
SKIP_INSTALL = YES;
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 4.0;
TARGETED_DEVICE_FAMILY = 3;
TVOS_DEPLOYMENT_TARGET = 9.0;
};
@@ -1315,7 +1315,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "org.futurekit.FutureKit.FutureKit-tvOSTests";
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = appletvos;
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 4.0;
TVOS_DEPLOYMENT_TARGET = 9.2;
};
name = Debug;
@@ -1330,7 +1330,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "org.futurekit.FutureKit.FutureKit-tvOSTests";
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = appletvos;
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 4.0;
TVOS_DEPLOYMENT_TARGET = 9.2;
};
name = Release;
@@ -1354,8 +1354,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "org.futureKit.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 4.0;
};
name = Debug;
};
@@ -1374,8 +1373,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "org.futureKit.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 4.0;
};
name = Release;
};
@@ -1399,7 +1397,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "org.futureKit.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "FutureKitTests/FutureKit iOS Tests-Bridging-Header.h";
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 4.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/FutureKit iOS Testing App.app/FutureKit iOS Testing App";
};
name = Debug;
@@ -1420,7 +1418,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "org.futureKit.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "FutureKitTests/FutureKit iOS Tests-Bridging-Header.h";
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 4.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/FutureKit iOS Testing App.app/FutureKit iOS Testing App";
};
name = Release;
@@ -1449,8 +1447,7 @@
PRODUCT_NAME = FutureKit;
PROVISIONING_PROFILE_SPECIFIER = "";
SKIP_INSTALL = YES;
SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 4.0;
};
name = Debug;
};
@@ -1475,8 +1472,7 @@
PROVISIONING_PROFILE_SPECIFIER = "";
SKIP_INSTALL = YES;
SWIFT_DISABLE_SAFETY_CHECKS = YES;
SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 4.0;
};
name = Release;
};
@@ -1503,7 +1499,7 @@
PRODUCT_NAME = FutureKit;
SDKROOT = macosx;
SKIP_INSTALL = YES;
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 4.0;
};
name = Debug;
};
@@ -1525,7 +1521,7 @@
PRODUCT_NAME = FutureKit;
SDKROOT = macosx;
SKIP_INSTALL = YES;
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 4.0;
};
name = Release;
};
@@ -1547,8 +1543,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "org.futurekit.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "FutureKitTests/FutureKit iOS Tests-Bridging-Header.h";
SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 4.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/FutureKit iOS Testing App.app/FutureKit iOS Testing App";
};
name = Debug;
@@ -1567,8 +1562,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "org.futurekit.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "FutureKitTests/FutureKit iOS Tests-Bridging-Header.h";
SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 4.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/FutureKit iOS Testing App.app/FutureKit iOS Testing App";
};
name = Release;
@@ -1596,7 +1590,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = macosx;
SWIFT_OBJC_BRIDGING_HEADER = "FutureKitTests/FutureKit OSX Tests-Bridging-Header.h";
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 4.0;
};
name = Debug;
};
@@ -1618,7 +1612,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = macosx;
SWIFT_OBJC_BRIDGING_HEADER = "FutureKitTests/FutureKit OSX Tests-Bridging-Header.h";
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 4.0;
};
name = Release;
};
@@ -482,7 +482,11 @@ public enum Executor {
precondition(leeway >= 0)

let timerSource = DispatchSource.makeTimerSource()
timerSource.scheduleRepeating(wallDeadline: DispatchWallTime(date), interval: DispatchTimeInterval(repeatingEvery), leeway: DispatchTimeInterval(leeway))
#if swift(>=4.0)
timerSource.schedule(wallDeadline: DispatchWallTime(date), repeating: DispatchTimeInterval(repeatingEvery), leeway: DispatchTimeInterval(leeway))
#else
timerSource.scheduleRepeating(wallDeadline: DispatchWallTime(date), interval: DispatchTimeInterval(repeatingEvery), leeway: DispatchTimeInterval(leeway))
#endif

timerSource.setEventHandler {
self.execute(action)
@@ -2,7 +2,7 @@
//: Make sure you opened this inside the FutureKit workspace. Opening the playground file directly, usually means it can't import FutureKit module correctly. If import FutureKit is failing, make sure you build the OSX Framework in the workspace!
import FutureKit
import PlaygroundSupport
PlaygroundPage.currentPage.needsIndefiniteExecution = true
PlaygroundPage.current.needsIndefiniteExecution = true
//: # Let's get started!
//: This is a Future:
@@ -17,7 +17,6 @@ let resultOfFuture5 = future5Int.result!
let futureFail = Future<Int>(failWithErrorMessage:"I have no 5's for you today.")
let failed5result = futureFail.result
let e = futureFail.error
//: Sometimes your request is cancelled. It's not usually because of a failure, and usually means we just wanted to halt an async process before it was done. Optionally you can send a reason, but it's not required. In FutureKit a Fail means that something went wrong, and you should cope with that. a Cancel is usually considered "legal", like canceling active API requests when a window is closed.
let cancelledFuture = Future<Int>(cancelled: ())
let cancelledResult = cancelledFuture.result
//: These aren't very interesting Futures. Let's make something a bit more interesting:
@@ -62,7 +61,7 @@ futureFail.onFail { (error) -> Void in

cancelledFuture.onCancel { () -> Void in
let e = "cancelled!"
print("cancelled")
print(e)
}

//: But if you don't want to add 3 handlers, it's more common to just add a single onComplete handler
@@ -71,8 +70,10 @@ asyncFuture5.onComplete { (result : FutureResult<Int>) -> Void in
switch result {
case let .success(value):
let five = value
print("success(\(five))")
case let .fail(error):
let e = error
print("error(\(e.localizedDescription))")
case .cancelled:
break
}
@@ -84,7 +85,7 @@ let completionOfAsyncFuture5 = asyncFuture5.result!

FutureBatch([asyncFuture5,cancelledFuture,futureFail]).resultsFuture.onComplete(.mainAsync) { _ in
PlaygroundPage.currentPage.finishExecution()
PlaygroundPage.current.finishExecution()
}
//: Seems easy? Let's make them more fun..
//: [Next](@next)
Oops, something went wrong.

0 comments on commit 6c2968d

Please sign in to comment.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.