I'm trying to read/write data in extra class file which is public. (StoreData.swift)
My function :
func FetchName (NameforDate: String) -> NSString
{
var appDel:AppDelegate = (UIApplication.sharedApplication().delegate as AppDelegate)
var context:NSManagedObjectContext = appDel.managedObjectContext!
}
At line where is "(UIApplication.sharedApplication()." I get the error:
StoreData.swift:115:49: 'sharedApplication()' is unavailable: Use view controller based solutions where appropriate instead.
I created App and Today Extension.