ios - NSFetchedResultsController count in Swift -
i novice swift developer coming objective-c background. i have following code: class kpcoredataresultscontroller: nsobject, nsfetchedresultscontrollerdelegate { var fetchedresultscontroller: nsfetchedresultscontroller let managedobjectcontext = (uiapplication.sharedapplication().delegate as! appdelegate).managedobjectcontext! let entityname: nsstring var delegate: kpcoredataresultsdelegate? var predicate: nspredicate { { return fetchedresultscontroller.fetchrequest.predicate! } set { fetchedresultscontroller.fetchrequest.predicate = newvalue { try fetchedresultscontroller.performfetch() } catch { print(error) } } } var sortdescriptor: nssortdescriptor! var count: nsinteger { return (fetchedresultscontroller.sections!.first!).numberofobjects } init(entityname: string, predicate: nspredicate, s...