I have the following function that requests reminder permission from the user:
func requestAccess(alertWith viewController: UIViewController) -> Bool {
eventStore.requestAccess(to: .reminder) { (granted, error) in
// check wether the user granted permission
if granted {
// FIXME: return true
} else {
// alert the user they didn't grant permission
error?.alert(with: viewController, error: .permissionFailed(error!))
// FIXME: return false
}
}
}
It should return the 2 bools at the FIXMEs, but using plain return doesn't work (returning non-void from void method).