Commit 77094658 by Daniel Dahan

development: fixed issue where Xcode 8 GM updated @escaping behaviour issue-514

parent 42b26c64
...@@ -126,7 +126,7 @@ public struct Animation { ...@@ -126,7 +126,7 @@ public struct Animation {
/** /**
:name: animateWithDelay :name: animateWithDelay
*/ */
public static func animateWithDelay(delay d: CFTimeInterval, duration: CFTimeInterval, animations: (() -> Void), completion: (() -> Void)? = nil) { public static func animateWithDelay(delay d: CFTimeInterval, duration: CFTimeInterval, animations: @escaping (() -> Void), completion: (() -> Void)? = nil) {
_ = delay(time: d) { _ = delay(time: d) {
animateWithDuration(duration: duration, animations: animations, completion: completion) animateWithDuration(duration: duration, animations: animations, completion: completion)
} }
......
...@@ -185,8 +185,8 @@ extension UIImage { ...@@ -185,8 +185,8 @@ extension UIImage {
- Parameter completion: A completion block that is executed once the image - Parameter completion: A completion block that is executed once the image
has been retrieved. has been retrieved.
*/ */
open class func contentsOfURL(url: URL, completion: ((UIImage?, Error?) -> Void)) { open class func contentsOfURL(url: URL, completion: @escaping ((UIImage?, Error?) -> Void)) {
URLSession.shared.dataTask(with: URLRequest(url: url)) { (data: Data?, response: URLResponse?, error: Error?) in URLSession.shared.dataTask(with: URLRequest(url: url)) { [completion = completion] (data: Data?, response: URLResponse?, error: Error?) in
DispatchQueue.main.async { DispatchQueue.main.async {
if let v = error { if let v = error {
completion(nil, v) completion(nil, v)
......
...@@ -173,7 +173,7 @@ open class PageTabBarController: RootController { ...@@ -173,7 +173,7 @@ open class PageTabBarController: RootController {
- Parameter animated: A boolean indicating to include animation. - Parameter animated: A boolean indicating to include animation.
- Parameter completion: An optional completion block. - Parameter completion: An optional completion block.
*/ */
open func setViewControllers(_ viewControllers: [UIViewController], direction: UIPageViewControllerNavigationDirection, animated: Bool, completion: (@escaping (Bool) -> Void)? = nil) { open func setViewControllers(_ viewControllers: [UIViewController], direction: UIPageViewControllerNavigationDirection, animated: Bool, completion: ((Bool) -> Void)? = nil) {
pageViewController?.setViewControllers(viewControllers, direction: direction, animated: animated, completion: completion) pageViewController?.setViewControllers(viewControllers, direction: direction, animated: animated, completion: completion)
preparePageTabBarItems() preparePageTabBarItems()
} }
......
...@@ -214,7 +214,7 @@ extension PhotoLibrary { ...@@ -214,7 +214,7 @@ extension PhotoLibrary {
- Parameter _ completion: A completion block that passes in a PHAuthorizationStatus - Parameter _ completion: A completion block that passes in a PHAuthorizationStatus
enum that describes the response for the authorization request. enum that describes the response for the authorization request.
*/ */
public func requestAuthorization(_ completion: (@escaping (PHAuthorizationStatus) -> Void)? = nil) { public func requestAuthorization(_ completion: ((PHAuthorizationStatus) -> Void)? = nil) {
PHPhotoLibrary.requestAuthorization { [weak self, completion = completion] (status) in PHPhotoLibrary.requestAuthorization { [weak self, completion = completion] (status) in
DispatchQueue.main.async { [weak self, completion = completion] in DispatchQueue.main.async { [weak self, completion = completion] in
guard let s = self else { guard let s = self else {
...@@ -254,7 +254,7 @@ extension PhotoLibrary { ...@@ -254,7 +254,7 @@ extension PhotoLibrary {
- Parameter fetchResult: A PHFetchResult<T>. - Parameter fetchResult: A PHFetchResult<T>.
- Parameter completion: A completion block. - Parameter completion: A completion block.
*/ */
internal func fetch<T: PHObject, U: PHFetchResult<T>>(caller: String, result: U, completion: (@escaping ([T], U) -> Void)? = nil) -> [T] { internal func fetch<T: PHObject, U: PHFetchResult<T>>(caller: String, result: U, completion: (([T], U) -> Void)? = nil) -> [T] {
var objects = [T]() var objects = [T]()
result.enumerateObjects({ (collection, _, _) in result.enumerateObjects({ (collection, _, _) in
...@@ -287,7 +287,7 @@ extension PhotoLibrary { ...@@ -287,7 +287,7 @@ extension PhotoLibrary {
- Parameter options: An optional PHFetchOptions object. - Parameter options: An optional PHFetchOptions object.
- Parameter completion: A completion callback. - Parameter completion: A completion callback.
*/ */
public func fetchCollectionListsContaining(_ collection: PHCollection, options: PHFetchOptions?, completion: (@escaping ([PHCollectionList], PHFetchResult<PHCollectionList>) -> Void)? = nil) -> [PHCollectionList] { public func fetchCollectionListsContaining(_ collection: PHCollection, options: PHFetchOptions?, completion: (([PHCollectionList], PHFetchResult<PHCollectionList>) -> Void)? = nil) -> [PHCollectionList] {
return fetch(caller: #function, result: PHCollectionList.fetchCollectionListsContaining(collection, options: options), completion: completion) return fetch(caller: #function, result: PHCollectionList.fetchCollectionListsContaining(collection, options: options), completion: completion)
} }
...@@ -298,7 +298,7 @@ extension PhotoLibrary { ...@@ -298,7 +298,7 @@ extension PhotoLibrary {
- Parameter options: An optional PHFetchOptions object. - Parameter options: An optional PHFetchOptions object.
- Parameter completion: A completion callback. - Parameter completion: A completion callback.
*/ */
public func fetchCollectionList(with type: PHCollectionListType, subtype: PHCollectionListSubtype, options: PHFetchOptions?, completion: (@escaping ([PHCollectionList], PHFetchResult<PHCollectionList>) -> Void)? = nil) -> [PHCollectionList] { public func fetchCollectionList(with type: PHCollectionListType, subtype: PHCollectionListSubtype, options: PHFetchOptions?, completion: (([PHCollectionList], PHFetchResult<PHCollectionList>) -> Void)? = nil) -> [PHCollectionList] {
return fetch(caller: #function, result: PHCollectionList.fetchCollectionLists(with: type, subtype: subtype, options: options), completion: completion) return fetch(caller: #function, result: PHCollectionList.fetchCollectionLists(with: type, subtype: subtype, options: options), completion: completion)
} }
...@@ -311,7 +311,7 @@ extension PhotoLibrary { ...@@ -311,7 +311,7 @@ extension PhotoLibrary {
- Parameter options: An optional PHFetchOptions object. - Parameter options: An optional PHFetchOptions object.
- Parameter completion: A completion callback. - Parameter completion: A completion callback.
*/ */
public func fetchCollectionLists(withLocalIdentifiers identifiers: [String], options: PHFetchOptions?, completion: (@escaping ([PHCollectionList], PHFetchResult<PHCollectionList>) -> Void)? = nil) -> [PHCollectionList] { public func fetchCollectionLists(withLocalIdentifiers identifiers: [String], options: PHFetchOptions?, completion: (([PHCollectionList], PHFetchResult<PHCollectionList>) -> Void)? = nil) -> [PHCollectionList] {
return fetch(caller: #function, result: PHCollectionList.fetchCollectionLists(withLocalIdentifiers: identifiers, options: options), completion: completion) return fetch(caller: #function, result: PHCollectionList.fetchCollectionLists(withLocalIdentifiers: identifiers, options: options), completion: completion)
} }
...@@ -324,7 +324,7 @@ extension PhotoLibrary { ...@@ -324,7 +324,7 @@ extension PhotoLibrary {
- Parameter options: An optional PHFetchOptions object. - Parameter options: An optional PHFetchOptions object.
- Parameter completion: A completion callback. - Parameter completion: A completion callback.
*/ */
public func fetchCollectionLists(with collectionListType: PHCollectionListType, subtype: PHCollectionListSubtype, options: PHFetchOptions?, completion: (@escaping ([PHCollectionList], PHFetchResult<PHCollectionList>) -> Void)? = nil) -> [PHCollectionList] { public func fetchCollectionLists(with collectionListType: PHCollectionListType, subtype: PHCollectionListSubtype, options: PHFetchOptions?, completion: (([PHCollectionList], PHFetchResult<PHCollectionList>) -> Void)? = nil) -> [PHCollectionList] {
return fetch(caller: #function, result: PHCollectionList.fetchCollectionLists(with: collectionListType, subtype: subtype, options: options), completion: completion) return fetch(caller: #function, result: PHCollectionList.fetchCollectionLists(with: collectionListType, subtype: subtype, options: options), completion: completion)
} }
...@@ -335,7 +335,7 @@ extension PhotoLibrary { ...@@ -335,7 +335,7 @@ extension PhotoLibrary {
- Parameter options: An optional PHFetchOptions object. - Parameter options: An optional PHFetchOptions object.
- Parameter completion: A completion callback. - Parameter completion: A completion callback.
*/ */
public func fetchMomentLists(with momentListSubtype: PHCollectionListSubtype, containingMoment moment: PHAssetCollection, options: PHFetchOptions?, completion: (@escaping ([PHCollectionList], PHFetchResult<PHCollectionList>) -> Void)? = nil) -> [PHCollectionList] { public func fetchMomentLists(with momentListSubtype: PHCollectionListSubtype, containingMoment moment: PHAssetCollection, options: PHFetchOptions?, completion: (([PHCollectionList], PHFetchResult<PHCollectionList>) -> Void)? = nil) -> [PHCollectionList] {
return fetch(caller: #function, result: PHCollectionList.fetchMomentLists(with: momentListSubtype, containingMoment: moment, options: options), completion: completion) return fetch(caller: #function, result: PHCollectionList.fetchMomentLists(with: momentListSubtype, containingMoment: moment, options: options), completion: completion)
} }
...@@ -345,7 +345,7 @@ extension PhotoLibrary { ...@@ -345,7 +345,7 @@ extension PhotoLibrary {
- Parameter options: An optional PHFetchOptions object. - Parameter options: An optional PHFetchOptions object.
- Parameter completion: A completion callback. - Parameter completion: A completion callback.
*/ */
public func fetchMomentLists(with momentListSubtype: PHCollectionListSubtype, options: PHFetchOptions?, completion: (@escaping ([PHCollectionList], PHFetchResult<PHCollectionList>) -> Void)? = nil) -> [PHCollectionList] { public func fetchMomentLists(with momentListSubtype: PHCollectionListSubtype, options: PHFetchOptions?, completion: (([PHCollectionList], PHFetchResult<PHCollectionList>) -> Void)? = nil) -> [PHCollectionList] {
return fetch(caller: #function, result: PHCollectionList.fetchMomentLists(with: momentListSubtype, options: options), completion: completion) return fetch(caller: #function, result: PHCollectionList.fetchMomentLists(with: momentListSubtype, options: options), completion: completion)
} }
} }
...@@ -358,7 +358,7 @@ extension PhotoLibrary { ...@@ -358,7 +358,7 @@ extension PhotoLibrary {
- Parameter options: An optional PHFetchOptions object. - Parameter options: An optional PHFetchOptions object.
- Parameter completion: A completion callback. - Parameter completion: A completion callback.
*/ */
public func fetchCollections(in collectionList: PHCollectionList, options: PHFetchOptions?, completion: (@escaping ([PHCollection], PHFetchResult<PHCollection>) -> Void)? = nil) -> [PHCollection] { public func fetchCollections(in collectionList: PHCollectionList, options: PHFetchOptions?, completion: (([PHCollection], PHFetchResult<PHCollection>) -> Void)? = nil) -> [PHCollection] {
return fetch(caller: #function, result: PHCollection.fetchCollections(in: collectionList, options: options), completion: completion) return fetch(caller: #function, result: PHCollection.fetchCollections(in: collectionList, options: options), completion: completion)
} }
...@@ -369,7 +369,7 @@ extension PhotoLibrary { ...@@ -369,7 +369,7 @@ extension PhotoLibrary {
- Parameter options: An optional PHFetchOptions object. - Parameter options: An optional PHFetchOptions object.
- Parameter completion: A completion callback. - Parameter completion: A completion callback.
*/ */
public func fetchTopLevelUserCollections(with options: PHFetchOptions?, completion: (@escaping ([PHCollection], PHFetchResult<PHCollection>) -> Void)? = nil) -> [PHCollection] { public func fetchTopLevelUserCollections(with options: PHFetchOptions?, completion: (([PHCollection], PHFetchResult<PHCollection>) -> Void)? = nil) -> [PHCollection] {
return fetch(caller: #function, result: PHCollection.fetchTopLevelUserCollections(with: nil), completion: completion) return fetch(caller: #function, result: PHCollection.fetchTopLevelUserCollections(with: nil), completion: completion)
} }
} }
...@@ -383,7 +383,7 @@ extension PhotoLibrary { ...@@ -383,7 +383,7 @@ extension PhotoLibrary {
- Parameter options: An optional PHFetchOptions object. - Parameter options: An optional PHFetchOptions object.
- Parameter completion: A completion block. - Parameter completion: A completion block.
*/ */
public func fetchAssetCollections(withLocalIdentifiers identifiers: [String], options: PHFetchOptions?, completion: (@escaping ([PHAssetCollection], PHFetchResult<PHAssetCollection>) -> Void)? = nil) -> [PHAssetCollection] { public func fetchAssetCollections(withLocalIdentifiers identifiers: [String], options: PHFetchOptions?, completion: (([PHAssetCollection], PHFetchResult<PHAssetCollection>) -> Void)? = nil) -> [PHAssetCollection] {
return fetch(caller: #function, result: PHAssetCollection.fetchAssetCollections(withLocalIdentifiers: identifiers, options: options), completion: completion) return fetch(caller: #function, result: PHAssetCollection.fetchAssetCollections(withLocalIdentifiers: identifiers, options: options), completion: completion)
} }
...@@ -395,7 +395,7 @@ extension PhotoLibrary { ...@@ -395,7 +395,7 @@ extension PhotoLibrary {
- Parameter options: An optional PHFetchOptions object. - Parameter options: An optional PHFetchOptions object.
- Parameter completion: A completion block. - Parameter completion: A completion block.
*/ */
public func fetchAssetCollections(with type: PHAssetCollectionType, subtype: PHAssetCollectionSubtype, options: PHFetchOptions?, completion: (@escaping ([PHAssetCollection], PHFetchResult<PHAssetCollection>) -> Void)? = nil) -> [PHAssetCollection] { public func fetchAssetCollections(with type: PHAssetCollectionType, subtype: PHAssetCollectionSubtype, options: PHFetchOptions?, completion: (([PHAssetCollection], PHFetchResult<PHAssetCollection>) -> Void)? = nil) -> [PHAssetCollection] {
return fetch(caller: #function, result: PHAssetCollection.fetchAssetCollections(with: type, subtype: subtype, options: options), completion: completion) return fetch(caller: #function, result: PHAssetCollection.fetchAssetCollections(with: type, subtype: subtype, options: options), completion: completion)
} }
...@@ -406,7 +406,7 @@ extension PhotoLibrary { ...@@ -406,7 +406,7 @@ extension PhotoLibrary {
- Parameter options: An optional PHFetchOptions object. - Parameter options: An optional PHFetchOptions object.
- Parameter completion: A completion block. - Parameter completion: A completion block.
*/ */
public func fetchAssetCollectionsContaining(_ asset: PHAsset, with type: PHAssetCollectionType, options: PHFetchOptions?, completion: (@escaping ([PHAssetCollection], PHFetchResult<PHAssetCollection>) -> Void)? = nil) -> [PHAssetCollection] { public func fetchAssetCollectionsContaining(_ asset: PHAsset, with type: PHAssetCollectionType, options: PHFetchOptions?, completion: (([PHAssetCollection], PHFetchResult<PHAssetCollection>) -> Void)? = nil) -> [PHAssetCollection] {
return fetch(caller: #function, result: PHAssetCollection.fetchAssetCollectionsContaining(asset, with: type, options: options), completion: completion) return fetch(caller: #function, result: PHAssetCollection.fetchAssetCollectionsContaining(asset, with: type, options: options), completion: completion)
} }
...@@ -418,7 +418,7 @@ extension PhotoLibrary { ...@@ -418,7 +418,7 @@ extension PhotoLibrary {
- Parameter options: An optional PHFetchOptions object. - Parameter options: An optional PHFetchOptions object.
- Parameter completion: A completion block. - Parameter completion: A completion block.
*/ */
public func fetchAssetCollections(withALAssetGroupURLs assetGroupURLs: [URL], options: PHFetchOptions?, completion: (@escaping ([PHAssetCollection], PHFetchResult<PHAssetCollection>) -> Void)? = nil) -> [PHAssetCollection] { public func fetchAssetCollections(withALAssetGroupURLs assetGroupURLs: [URL], options: PHFetchOptions?, completion: (([PHAssetCollection], PHFetchResult<PHAssetCollection>) -> Void)? = nil) -> [PHAssetCollection] {
return fetch(caller: #function, result: PHAssetCollection.fetchAssetCollections(withALAssetGroupURLs: assetGroupURLs, options: options), completion: completion) return fetch(caller: #function, result: PHAssetCollection.fetchAssetCollections(withALAssetGroupURLs: assetGroupURLs, options: options), completion: completion)
} }
...@@ -428,7 +428,7 @@ extension PhotoLibrary { ...@@ -428,7 +428,7 @@ extension PhotoLibrary {
- Parameter options: An optional PHFetchOptions object. - Parameter options: An optional PHFetchOptions object.
- Parameter completion: A completion block. - Parameter completion: A completion block.
*/ */
public func fetchMoments(inMomentList momentList: PHCollectionList, options: PHFetchOptions?, completion: (@escaping ([PHAssetCollection], PHFetchResult<PHAssetCollection>) -> Void)? = nil) -> [PHAssetCollection] { public func fetchMoments(inMomentList momentList: PHCollectionList, options: PHFetchOptions?, completion: (([PHAssetCollection], PHFetchResult<PHAssetCollection>) -> Void)? = nil) -> [PHAssetCollection] {
return fetch(caller: #function, result: PHAssetCollection.fetchMoments(inMomentList: momentList, options: options), completion: completion) return fetch(caller: #function, result: PHAssetCollection.fetchMoments(inMomentList: momentList, options: options), completion: completion)
} }
...@@ -437,7 +437,7 @@ extension PhotoLibrary { ...@@ -437,7 +437,7 @@ extension PhotoLibrary {
- Parameter with options: An optional PHFetchOptions object. - Parameter with options: An optional PHFetchOptions object.
- Parameter completion: A completion block. - Parameter completion: A completion block.
*/ */
public func fetchMoments(with options: PHFetchOptions?, completion: (@escaping ([PHAssetCollection], PHFetchResult<PHAssetCollection>) -> Void)? = nil) -> [PHAssetCollection] { public func fetchMoments(with options: PHFetchOptions?, completion: (([PHAssetCollection], PHFetchResult<PHAssetCollection>) -> Void)? = nil) -> [PHAssetCollection] {
return fetch(caller: #function, result: PHAssetCollection.fetchMoments(with: options), completion: completion) return fetch(caller: #function, result: PHAssetCollection.fetchMoments(with: options), completion: completion)
} }
} }
...@@ -450,7 +450,7 @@ extension PhotoLibrary { ...@@ -450,7 +450,7 @@ extension PhotoLibrary {
- Parameter options: An optional PHFetchOptions object. - Parameter options: An optional PHFetchOptions object.
- Parameter completion: A completion block. - Parameter completion: A completion block.
*/ */
public func fetchAssets(in assetCollection: PHAssetCollection, options: PHFetchOptions?, completion: (@escaping ([PHAsset], PHFetchResult<PHAsset>) -> Void)? = nil) -> [PHAsset] { public func fetchAssets(in assetCollection: PHAssetCollection, options: PHFetchOptions?, completion: (([PHAsset], PHFetchResult<PHAsset>) -> Void)? = nil) -> [PHAsset] {
return fetch(caller: #function, result: PHAsset.fetchAssets(in: assetCollection, options: options), completion: completion) return fetch(caller: #function, result: PHAsset.fetchAssets(in: assetCollection, options: options), completion: completion)
} }
...@@ -461,7 +461,7 @@ extension PhotoLibrary { ...@@ -461,7 +461,7 @@ extension PhotoLibrary {
- Parameter options: An optional PHFetchOptions object. - Parameter options: An optional PHFetchOptions object.
- Parameter completion: A completion block. - Parameter completion: A completion block.
*/ */
public func fetchAssets(withLocalIdentifiers identifiers: [String], options: PHFetchOptions?, completion: (@escaping ([PHAsset], PHFetchResult<PHAsset>) -> Void)? = nil) -> [PHAsset] { public func fetchAssets(withLocalIdentifiers identifiers: [String], options: PHFetchOptions?, completion: (([PHAsset], PHFetchResult<PHAsset>) -> Void)? = nil) -> [PHAsset] {
return fetch(caller: #function, result: PHAsset.fetchAssets(withLocalIdentifiers: identifiers, options: options), completion: completion) return fetch(caller: #function, result: PHAsset.fetchAssets(withLocalIdentifiers: identifiers, options: options), completion: completion)
} }
...@@ -472,7 +472,7 @@ extension PhotoLibrary { ...@@ -472,7 +472,7 @@ extension PhotoLibrary {
- Parameter completion: A completion block. - Parameter completion: A completion block.
- Returns: An optional PHFetchResult<PHAsset> object. - Returns: An optional PHFetchResult<PHAsset> object.
*/ */
public func fetchKeyAssets(in assetCollection: PHAssetCollection, options: PHFetchOptions?, completion: (@escaping ([PHAsset], PHFetchResult<PHAsset>) -> Void)? = nil) -> PHFetchResult<PHAsset>? { public func fetchKeyAssets(in assetCollection: PHAssetCollection, options: PHFetchOptions?, completion: (([PHAsset], PHFetchResult<PHAsset>) -> Void)? = nil) -> PHFetchResult<PHAsset>? {
guard let fetchResult = PHAsset.fetchKeyAssets(in: assetCollection, options: options) else { guard let fetchResult = PHAsset.fetchKeyAssets(in: assetCollection, options: options) else {
return nil return nil
} }
...@@ -487,7 +487,7 @@ extension PhotoLibrary { ...@@ -487,7 +487,7 @@ extension PhotoLibrary {
- Parameter options: An optional PHFetchOptions object. - Parameter options: An optional PHFetchOptions object.
- Parameter completion: A completion block. - Parameter completion: A completion block.
*/ */
public func fetchAssets(withBurstIdentifier burstIdentifier: String, options: PHFetchOptions?, completion: (@escaping ([PHAsset], PHFetchResult<PHAsset>) -> Void)? = nil) -> [PHAsset] { public func fetchAssets(withBurstIdentifier burstIdentifier: String, options: PHFetchOptions?, completion: (([PHAsset], PHFetchResult<PHAsset>) -> Void)? = nil) -> [PHAsset] {
return fetch(caller: #function, result: PHAsset.fetchAssets(withBurstIdentifier: burstIdentifier, options: options), completion: completion) return fetch(caller: #function, result: PHAsset.fetchAssets(withBurstIdentifier: burstIdentifier, options: options), completion: completion)
} }
...@@ -497,7 +497,7 @@ extension PhotoLibrary { ...@@ -497,7 +497,7 @@ extension PhotoLibrary {
- Parameter with options: An optional PHFetchOptions object. - Parameter with options: An optional PHFetchOptions object.
- Parameter completion: A completion block. - Parameter completion: A completion block.
*/ */
public func fetchAssets(with options: PHFetchOptions?, completion: (@escaping ([PHAsset], PHFetchResult<PHAsset>) -> Void)? = nil) -> [PHAsset] { public func fetchAssets(with options: PHFetchOptions?, completion: (([PHAsset], PHFetchResult<PHAsset>) -> Void)? = nil) -> [PHAsset] {
return fetch(caller: #function, result: PHAsset.fetchAssets(with: options), completion: completion) return fetch(caller: #function, result: PHAsset.fetchAssets(with: options), completion: completion)
} }
...@@ -507,7 +507,7 @@ extension PhotoLibrary { ...@@ -507,7 +507,7 @@ extension PhotoLibrary {
- Parameter options: An optional PHFetchOptions object. - Parameter options: An optional PHFetchOptions object.
- Parameter completion: A completion block. - Parameter completion: A completion block.
*/ */
public func fetchAssets(with mediaType: PHAssetMediaType, options: PHFetchOptions?, completion: (@escaping ([PHAsset], PHFetchResult<PHAsset>) -> Void)? = nil) -> [PHAsset] { public func fetchAssets(with mediaType: PHAssetMediaType, options: PHFetchOptions?, completion: (([PHAsset], PHFetchResult<PHAsset>) -> Void)? = nil) -> [PHAsset] {
return fetch(caller: #function, result: PHAsset.fetchAssets(with: mediaType, options: options), completion: completion) return fetch(caller: #function, result: PHAsset.fetchAssets(with: mediaType, options: options), completion: completion)
} }
...@@ -518,7 +518,7 @@ extension PhotoLibrary { ...@@ -518,7 +518,7 @@ extension PhotoLibrary {
- Parameter options: An optional PHFetchOptions object. - Parameter options: An optional PHFetchOptions object.
- Parameter completion: A completion block. - Parameter completion: A completion block.
*/ */
public func fetchAssets(withALAssetURLs assetURLs: [URL], options: PHFetchOptions?, completion: (@escaping ([PHAsset], PHFetchResult<PHAsset>) -> Void)? = nil) -> [PHAsset] { public func fetchAssets(withALAssetURLs assetURLs: [URL], options: PHFetchOptions?, completion: (([PHAsset], PHFetchResult<PHAsset>) -> Void)? = nil) -> [PHAsset] {
return fetch(caller: #function, result: PHAsset.fetchAssets(withALAssetURLs: assetURLs, options: options), completion: completion) return fetch(caller: #function, result: PHAsset.fetchAssets(withALAssetURLs: assetURLs, options: options), completion: completion)
} }
} }
......
...@@ -108,7 +108,7 @@ open class Reminders: NSObject { ...@@ -108,7 +108,7 @@ open class Reminders: NSObject {
/// A reference to a RemindersDelegate. /// A reference to a RemindersDelegate.
open weak var delegate: RemindersDelegate? open weak var delegate: RemindersDelegate?
open func requestAuthorization(_ completion: (@escaping (RemindersAuthorizationStatus) -> Void)? = nil) { open func requestAuthorization(_ completion: ((RemindersAuthorizationStatus) -> Void)? = nil) {
eventStore.requestAccess(to: .reminder) { [weak self, completion = completion] (permission, _) in eventStore.requestAccess(to: .reminder) { [weak self, completion = completion] (permission, _) in
DispatchQueue.main.async { [weak self, completion = completion] in DispatchQueue.main.async { [weak self, completion = completion] in
guard let s = self else { guard let s = self else {
...@@ -136,7 +136,7 @@ extension Reminders { ...@@ -136,7 +136,7 @@ extension Reminders {
- Parameter list title: the name of the list - Parameter list title: the name of the list
- Parameter completion: optional completion call back - Parameter completion: optional completion call back
*/ */
public func create(list title: String, completion: (@escaping (Bool, Error?) -> Void)? = nil) { public func create(list title: String, completion: ((Bool, Error?) -> Void)? = nil) {
DispatchQueue.global(qos: .default).async { [weak self, completion = completion] in DispatchQueue.global(qos: .default).async { [weak self, completion = completion] in
guard let s = self else { guard let s = self else {
return return
...@@ -176,7 +176,7 @@ extension Reminders { ...@@ -176,7 +176,7 @@ extension Reminders {
- Parameter list identifier: the name of the list - Parameter list identifier: the name of the list
- Parameter completion: optional completion call back - Parameter completion: optional completion call back
*/ */
public func delete(list identifier: String, completion: (@escaping (Bool, Error?) -> Void)? = nil) { public func delete(list identifier: String, completion: ((Bool, Error?) -> Void)? = nil) {
DispatchQueue.global(qos: .default).async { [weak self, completion = completion] in DispatchQueue.global(qos: .default).async { [weak self, completion = completion] in
guard let s = self else { guard let s = self else {
return return
...@@ -242,7 +242,7 @@ extension Reminders { ...@@ -242,7 +242,7 @@ extension Reminders {
if the list does not exist it will be added to the default reminders list. if the list does not exist it will be added to the default reminders list.
- Parameter completion: optional completion call back - Parameter completion: optional completion call back
*/ */
public func create(title: String, dateComponents: DateComponents, in list: EKCalendar? = nil, completion: (@escaping (Error?) -> Void)? = nil) { public func create(title: String, dateComponents: DateComponents, in list: EKCalendar? = nil, completion: ((Error?) -> Void)? = nil) {
var reminderCal = [EKCalendar]() var reminderCal = [EKCalendar]()
if list != nil { if list != nil {
...@@ -289,7 +289,7 @@ extension Reminders { ...@@ -289,7 +289,7 @@ extension Reminders {
if the list does not exist it will be added to the default reminders list. if the list does not exist it will be added to the default reminders list.
- Parameter completion: optional completion call back - Parameter completion: optional completion call back
*/ */
public func delete(reminder: EKReminder, completion: (@escaping (Error?) -> Void)? = nil) { public func delete(reminder: EKReminder, completion: ((Error?) -> Void)? = nil) {
var deleted: Bool = false var deleted: Bool = false
var error: Error? var error: Error?
do { do {
......
...@@ -38,7 +38,7 @@ public enum SnackbarStatus: Int { ...@@ -38,7 +38,7 @@ public enum SnackbarStatus: Int {
open class Snackbar: BarView { open class Snackbar: BarView {
/// A convenience property to set the titleLabel text. /// A convenience property to set the titleLabel text.
public var text: String? { open var text: String? {
get { get {
return textLabel.text return textLabel.text
} }
......
...@@ -102,7 +102,7 @@ open class SnackbarController: RootController { ...@@ -102,7 +102,7 @@ open class SnackbarController: RootController {
Animates to a SnackbarStatus. Animates to a SnackbarStatus.
- Parameter status: A SnackbarStatus enum value. - Parameter status: A SnackbarStatus enum value.
*/ */
open func animate(snackbar status: SnackbarStatus, delay: TimeInterval = 0, animations: (@escaping (Snackbar) -> Void)? = nil, completion: (@escaping (Snackbar) -> Void)? = nil) -> AnimationDelayCancelBlock { open func animate(snackbar status: SnackbarStatus, delay: TimeInterval = 0, animations: ((Snackbar) -> Void)? = nil, completion: ((Snackbar) -> Void)? = nil) -> AnimationDelayCancelBlock {
return Animation.delay(time: delay) { [weak self, status = status, animations = animations, completion = completion] in return Animation.delay(time: delay) { [weak self, status = status, animations = animations, completion = completion] in
guard let s = self else { guard let s = self else {
return return
......
...@@ -167,7 +167,7 @@ open class TabBar: BarView { ...@@ -167,7 +167,7 @@ open class TabBar: BarView {
- Parameter at index: An Int. - Parameter at index: An Int.
- Paramater completion: An optional completion block. - Paramater completion: An optional completion block.
*/ */
open func select(at index: Int, completion: (@escaping (UIButton) -> Void)? = nil) { open func select(at index: Int, completion: ((UIButton) -> Void)? = nil) {
guard -1 < index, index < buttons.count else { guard -1 < index, index < buttons.count else {
return return
} }
...@@ -179,7 +179,7 @@ open class TabBar: BarView { ...@@ -179,7 +179,7 @@ open class TabBar: BarView {
- Parameter to button: A UIButton. - Parameter to button: A UIButton.
- Paramater completion: An optional completion block. - Paramater completion: An optional completion block.
*/ */
open func animate(to button: UIButton, completion: (@escaping (UIButton) -> Void)? = nil) { open func animate(to button: UIButton, completion: ((UIButton) -> Void)? = nil) {
delegate?.tabBarWillSelectButton?(tabBar: self, button: button) delegate?.tabBarWillSelectButton?(tabBar: self, button: button)
selected = button selected = button
isAnimating = true isAnimating = true
......
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