Commit f4f1645c by Daniel Dahan

development: updated Reminders callback escaping

parent 735947b5
......@@ -109,7 +109,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 {
......@@ -137,7 +137,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
......@@ -177,7 +177,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
......@@ -243,7 +243,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 {
fetchLists(completion: { (calendars) in
......@@ -283,7 +283,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 {
......
......@@ -54,7 +54,7 @@ open class RemindersController: UIViewController {
open override func viewDidLoad() {
super.viewDidLoad()
prepareView()
prepare()
}
/**
......@@ -67,7 +67,7 @@ open class RemindersController: UIViewController {
open func prepare() {
view.clipsToBounds = true
view.backgroundColor = Color.white
view.contentScaleFactor = Device.scale
view.contentScaleFactor = Screen.scale
prepareReminders()
}
}
......
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