ios - How do I notify the UITableViewController of events from a UITableViewCell subclass? -


i have gesture recognizer on each of table view cells, , when swipe 1 want delegate notify table view (or if there's better way without delegates, that) can deleted. how know cell's indexpath or whatever can deleted?

using delegate pattern use this. custom cell class should define protocol , delegate property. view controller should set cell's delegate , view controller should implement cell's protocol method(s). make sure 1 of parameters of protocol methods cell.

the view controller can ask table view index path of cell if needed. there no need cell know index path. since rows , sections can added/deleted, bad form cell told index path since change @ time.


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -