Unverified Commit c53313b2 authored by Aral Balkan's avatar Aral Balkan
Browse files

Update to Swift 4

parent 7c2532f9
......@@ -146,10 +146,11 @@
1FA5CBA31DB3A7F0001294FD = {
CreatedOnToolsVersion = 8.0;
DevelopmentTeam = T47KPZ35V7;
LastSwiftMigration = 0900;
ProvisioningStyle = Automatic;
};
"______Target_Async" = {
LastSwiftMigration = 0800;
LastSwiftMigration = 0900;
};
};
};
......@@ -260,7 +261,8 @@
SDKROOT = iphoneos;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 3.0;
SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_VERSION = 4.0;
};
name = Debug;
};
......@@ -306,7 +308,8 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 3.0;
SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_VERSION = 4.0;
VALIDATE_PRODUCT = YES;
};
name = Release;
......@@ -325,7 +328,8 @@
PRODUCT_BUNDLE_IDENTIFIER = Async;
PRODUCT_MODULE_NAME = "$(TARGET_NAME:c99extidentifier)";
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SWIFT_VERSION = 3.0;
SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_VERSION = 4.0;
};
name = Release;
};
......@@ -344,7 +348,8 @@
PRODUCT_MODULE_NAME = "$(TARGET_NAME:c99extidentifier)";
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 3.0;
SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_VERSION = 4.0;
};
name = Debug;
};
......
......@@ -161,7 +161,7 @@ public struct AsyncBlock<In, Out> {
- SeeAlso: Has parity with non-static method
*/
@discardableResult
public static func main<O>(after seconds: Double? = nil, _ block: @escaping (Void) -> O) -> AsyncBlock<Void, O> {
public static func main<O>(after seconds: Double? = nil, _ block: @escaping () -> O) -> AsyncBlock<Void, O> {
return AsyncBlock.async(after: seconds, block: block, queue: .main)
}
......@@ -177,7 +177,7 @@ public struct AsyncBlock<In, Out> {
- SeeAlso: Has parity with non-static method
*/
@discardableResult
public static func userInteractive<O>(after seconds: Double? = nil, _ block: @escaping (Void) -> O) -> AsyncBlock<Void, O> {
public static func userInteractive<O>(after seconds: Double? = nil, _ block: @escaping () -> O) -> AsyncBlock<Void, O> {
return AsyncBlock.async(after: seconds, block: block, queue: .userInteractive)
}
......@@ -193,7 +193,7 @@ public struct AsyncBlock<In, Out> {
- SeeAlso: Has parity with non-static method
*/
@discardableResult
public static func userInitiated<O>(after seconds: Double? = nil, _ block: @escaping (Void) -> O) -> AsyncBlock<Void, O> {
public static func userInitiated<O>(after seconds: Double? = nil, _ block: @escaping () -> O) -> AsyncBlock<Void, O> {
return Async.async(after: seconds, block: block, queue: .userInitiated)
}
......@@ -209,7 +209,7 @@ public struct AsyncBlock<In, Out> {
- SeeAlso: Has parity with non-static method
*/
@discardableResult
public static func utility<O>(after seconds: Double? = nil, _ block: @escaping (Void) -> O) -> AsyncBlock<Void, O> {
public static func utility<O>(after seconds: Double? = nil, _ block: @escaping () -> O) -> AsyncBlock<Void, O> {
return Async.async(after: seconds, block: block, queue: .utility)
}
......@@ -225,7 +225,7 @@ public struct AsyncBlock<In, Out> {
- SeeAlso: Has parity with non-static method
*/
@discardableResult
public static func background<O>(after seconds: Double? = nil, _ block: @escaping (Void) -> O) -> AsyncBlock<Void, O> {
public static func background<O>(after seconds: Double? = nil, _ block: @escaping () -> O) -> AsyncBlock<Void, O> {
return Async.async(after: seconds, block: block, queue: .background)
}
......@@ -241,7 +241,7 @@ public struct AsyncBlock<In, Out> {
- SeeAlso: Has parity with non-static method
*/
@discardableResult
public static func custom<O>(queue: DispatchQueue, after seconds: Double? = nil, _ block: @escaping (Void) -> O) -> AsyncBlock<Void, O> {
public static func custom<O>(queue: DispatchQueue, after seconds: Double? = nil, _ block: @escaping () -> O) -> AsyncBlock<Void, O> {
return Async.async(after: seconds, block: block, queue: .custom(queue: queue))
}
......@@ -258,7 +258,7 @@ public struct AsyncBlock<In, Out> {
- returns: An `Async` struct which encapsulates the `@convention(block) () -> Swift.Void`
*/
private static func async<O>(after seconds: Double? = nil, block: @escaping (Void) -> O, queue: GCD) -> AsyncBlock<Void, O> {
private static func async<O>(after seconds: Double? = nil, block: @escaping () -> O, queue: GCD) -> AsyncBlock<Void, O> {
let reference = Reference<O>()
let block = DispatchWorkItem(block: {
reference.value = block()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment