Skip to content

Commit

Permalink
Merge pull request #74 from bradhowes/master
Browse files Browse the repository at this point in the history
Fix compile errors in Xcode 8.3 beta
  • Loading branch information
zenangst authored Mar 28, 2017
2 parents dec25e0 + 469147c commit a4c3064
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion Source/Shared/Cache.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,28 @@ public final class Cache<T: Cachable>: HybridCache {
- Parameter expiry: Expiration date for the cached object
- Parameter completion: Completion closure to be called when the task is done
*/
#if swift(>=3.1)
public override func add<T: Cachable>(_ key: String, object: T, expiry: Expiry? = nil, completion: (() -> Void)? = nil) {
super.add(key, object: object, expiry: expiry, completion: completion)
}
#else
public override func add(_ key: String, object: T, expiry: Expiry? = nil, completion: (() -> Void)? = nil) {
super.add(key, object: object, expiry: expiry, completion: completion)
}

#endif
/**
Tries to retrieve the object from to the front and back cache storages.
- Parameter key: Unique key to identify the object in the cache
- Parameter completion: Completion closure returns object or nil
*/
#if swift(>=3.1)
public override func object<T: Cachable>(_ key: String, completion: @escaping (_ object: T?) -> Void) {
super.object(key, completion: completion)
}
#else
public override func object(_ key: String, completion: @escaping (_ object: T?) -> Void) {
super.object(key, completion: completion)
}
#endif
}

0 comments on commit a4c3064

Please sign in to comment.