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 {
/**
: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) {
animateWithDuration(duration: duration, animations: animations, completion: completion)
}
......
......@@ -185,8 +185,8 @@ extension UIImage {
- Parameter completion: A completion block that is executed once the image
has been retrieved.
*/
open class func contentsOfURL(url: URL, completion: ((UIImage?, Error?) -> Void)) {
URLSession.shared.dataTask(with: URLRequest(url: url)) { (data: Data?, response: URLResponse?, error: Error?) in
open class func contentsOfURL(url: URL, completion: @escaping ((UIImage?, Error?) -> Void)) {
URLSession.shared.dataTask(with: URLRequest(url: url)) { [completion = completion] (data: Data?, response: URLResponse?, error: Error?) in
DispatchQueue.main.async {
if let v = error {
completion(nil, v)
......
......@@ -173,7 +173,7 @@ open class PageTabBarController: RootController {
- Parameter animated: A boolean indicating to include animation.
- 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)
preparePageTabBarItems()
}
......
......@@ -108,7 +108,7 @@ open class Reminders: NSObject {
/// A reference to a 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
DispatchQueue.main.async { [weak self, completion = completion] in
guard let s = self else {
......@@ -136,7 +136,7 @@ extension Reminders {
- Parameter list title: the name of the list
- 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
guard let s = self else {
return
......@@ -176,7 +176,7 @@ extension Reminders {
- Parameter list identifier: the name of the list
- 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
guard let s = self else {
return
......@@ -242,7 +242,7 @@ extension Reminders {
if the list does not exist it will be added to the default reminders list.
- 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]()
if list != nil {
......@@ -289,7 +289,7 @@ extension Reminders {
if the list does not exist it will be added to the default reminders list.
- 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 error: Error?
do {
......
......@@ -38,7 +38,7 @@ public enum SnackbarStatus: Int {
open class Snackbar: BarView {
/// A convenience property to set the titleLabel text.
public var text: String? {
open var text: String? {
get {
return textLabel.text
}
......
......@@ -102,7 +102,7 @@ open class SnackbarController: RootController {
Animates to a SnackbarStatus.
- 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
guard let s = self else {
return
......
......@@ -167,7 +167,7 @@ open class TabBar: BarView {
- Parameter at index: An Int.
- 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 {
return
}
......@@ -179,7 +179,7 @@ open class TabBar: BarView {
- Parameter to button: A UIButton.
- 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)
selected = button
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