Diogo Ribeiro
03/06/2019, 1:27 PMmarstran
03/06/2019, 1:27 PMDiogo Ribeiro
03/06/2019, 1:28 PMsitepodmatt
03/06/2019, 1:40 PMJonas Bark
03/06/2019, 1:50 PMclass TableViewTest : UITableView() {
override fun cellForRowAtIndexPath(indexPath: NSIndexPath): UITableViewCell? {
return super.cellForRowAtIndexPath(indexPath)
}
}
works fineDiogo Ribeiro
03/06/2019, 1:57 PMnestserau
03/06/2019, 1:59 PMUITableViewCell
is. Are your imports correct?Diogo Ribeiro
03/06/2019, 2:03 PMSam
03/06/2019, 4:19 PM@Suppress("RETURN_TYPE_MISMATCH_ON_OVERRIDE")
to the top of your class and it should compile.
One other note, there's no technical reason you can't have a subclass of a tableview act as its own data source or delegate but it isn't a practice looked favorably upon by other iOS developers. The most common practice is to have the UIViewController
controlling the tableview act as the data source and delegate. It's also acceptable to encapsulate that logic into separate class that conforms to one or both of those protocols.drofwarcs
03/06/2019, 4:40 PMjosephivie
03/06/2019, 5:38 PMDiogo Ribeiro
03/07/2019, 9:31 AM