How to subclass NSFetchedResultsController?

I want to override the following methods of NSFetchedResultsController:

func object(at indexPath: IndexPath) -> ResultType {...}
func indexPath(forObject object: ResultType) -> IndexPath? {...}


I do it like this: (swift 3, xcode8)

class MyFetchedResultsController<ResultType: NSFetchRequestResult>: NSFetchedResultsController<ResultType> {
}

but it give out this error:

inheritance from a generic Objective-C class 'NSFetchedResultsController' must bind type parameters of 'NSFetchedResultsController' to specific concrete types


How to handle this issue? thanks for you help.

I am just guessing.


What about replacing NSFetchedResultsController<ResultType> by


NSFetchedResultsController<NSFetchRequestResult>

It works,thanks to Claude31!


class MyFetchedResultsController<ResultType: NSFetchRequestResult>: NSFetchedResultsController<NSFetchRequestResult> {

open override func object(at indexPath: IndexPath) -> NSFetchRequestResult {
     return super.object(at: indexPath)
}

open override func indexPath(forObject object: NSFetchRequestResult) -> IndexPath? {
     return super.indexPath(forObject: object)
}
}
How to subclass NSFetchedResultsController?
 
 
Q