ios – Can I declare a operate inside a category with out physique in Swift?


So I used to be referring to the UIKit.UITableView file and I observed that each one the features inside UITableView class are written with out their physique. I attempted to do the identical in my mission however Xcode would not let me accomplish that. Can somebody clarify how was that doable within the supply file?

Under is a pattern snippet from there.

open func insertRows(at indexPaths: [IndexPath], with animation: UITableView.RowAnimation)

open func deleteRows(at indexPaths: [IndexPath], with animation: UITableView.RowAnimation)

@accessible(iOS 5.0, *)
open func moveRow(at indexPath: IndexPath, to newIndexPath: IndexPath)

@accessible(iOS 3.0, *)
open func reloadRows(at indexPaths: [IndexPath], with animation: UITableView.RowAnimation)

Leave a Reply