I'm trying to build an today extension for my app.
I'm using CoreData
and NSFetchedResultsController
and get the following error:
Use of undeclared type 'AppDelegate'
In this line of code:
var appDel: AppDelegate = UIApplication.sharedApplication().delegate as AppDelegate.
Does someone know how to solve this error / use AppDelegate in the today extension and would like to help me?
A Today Extension isn't an application, so UIApplication and AppDelegate aren't available. I'm not for sure what you are trying to do with the AppDelegate, but extensions do have a NSExtensionContext available by calling:
self.extensionContext
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With