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()
} }
......
...@@ -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