ResultsControllerDelegate
public protocol ResultsControllerDelegate : AnyObject
The ResultsControllerDelegate defines methods that allow you to respond to changes in the results controller.
Use ResultChangeSet to easily track changes and apply them to a CollectionView
-
controllerDidLoadContent(controller:)
Default implementationTells the delegate that the controller did load its initial content
Default Implementation
Declaration
Swift
func controllerDidLoadContent(controller: ResultsController)
Parameters
controller
The controller that loaded
-
Tells the delegate that the controller will change
Declaration
Swift
func controllerWillChangeContent(controller: ResultsController)
Parameters
controller
The controller that will change
-
Tells the delegate that the an object was changed
Declaration
Swift
func controller(_ controller: ResultsController, didChangeObject object: Any, at indexPath: IndexPath?, for changeType: ResultsControllerChangeType)
Parameters
controller
The controller
object
The object that changed
indexPath
The source index path of the object
changeType
The type of change
-
Tells the delegate that a section was changed
Declaration
Swift
func controller(_ controller: ResultsController, didChangeSection section: Any, at indexPath: IndexPath?, for changeType: ResultsControllerChangeType)
Parameters
controller
The controller
section
The info for the updated section
indexPath
the source index path of the section
changeType
The type of change
-
Tells the delegate that it has process all changes
Declaration
Swift
func controllerDidChangeContent(controller: ResultsController)
Parameters
controller
The controller that was changed