You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, i'm trying to create a customRow with 2 fields and a pushRow inside it. Is this possible? How can i import pushrow inside my customCell.xib, its extended from UiView? Thanks in advance.
The text was updated successfully, but these errors were encountered:
We can change the cell of a particular row by setting up its cellProvider property.
Cell Type can not be changed since it's defined in the row type using generics.
Taking as an example the WeeklyDayRow, as we can see below it only works with WeekDayCell as its type defines.
publicstructCellProvider<Cell:BaseCellwhere Cell:CellType>{/// Nibname of the cell that will be created.publicprivate (set)varnibName:String?/// Bundle from which to get the nib file.publicprivate (set)varbundle:NSBundle!publicinit(){}publicinit(nibName:String, bundle:NSBundle?=nil){self.nibName = nibName
self.bundle = bundle ??NSBundle(forClass:Cell.self)}/** Creates the cell with the specified style. - parameter cellStyle: The style with which the cell will be created. - returns: the cell */func createCell(cellStyle:UITableViewCellStyle)->Cell{
if let nibName =self.nibName {return bundle.loadNibNamed(nibName, owner:nil, options:nil).first as!Cell}returnCell.init(style: cellStyle, reuseIdentifier:nil)}}
Since PushRow<T> cell must be a PushSelectorCell<T> and we can not use generic types from interface builder, the only option we have is go for custom rows.
In oder to use a xib file to load the view of your custom row cell, you should set up your custom row cellProvider property.
Hi, i'm trying to create a customRow with 2 fields and a pushRow inside it. Is this possible? How can i import pushrow inside my customCell.xib, its extended from UiView? Thanks in advance.
The text was updated successfully, but these errors were encountered: