. , , whys.
, ViewControllers . , , "-", , .. TableViewController :
SampleTVC.swift
class SampleTableViewController: UITableViewController {
@IBOutlet var someLabel: UILabel!
@IBOutlet var someButton: UIButton!
@IBAction func unwindHere(_ segue: UIStoryBoardSegue) {
doSomething()
}
}
SampleDelegate + DataSource.swift
extension SampleTableViewController {
override func numberOfSections(in tableView: UITableView) -> Int
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell
}
SampleFetchedResultsController.swift
extension SampleTableViewController: NSFetchedResultsControllerDelegate {
var fetchedResultsController: NSFetchedResultsController<Item>
func controllerWillChangeContent(_ controller: NSFetchedResultsController<NSFetchRequestResult>)
func controller(_ controller: NSFetchedResultsController<NSFetchRequestResult>, didChange sectionInfo: NSFetchedResultsSectionInfo, atSectionIndex sectionIndex: Int, for type: NSFetchedResultsChangeType)
func controller(_ controller: NSFetchedResultsController<NSFetchRequestResult>, didChange anObject: Any, at indexPath: IndexPath?, for type: NSFetchedResultsChangeType, newIndexPath: IndexPath?)
func controllerDidChangeContent(_ controller: NSFetchedResultsController<NSFetchRequestResult>)
}
TVC, , rewind.
, , SampleTableViewController, .
, , , . , .