I’m trying to use FlexibleAdapter with Fire. FlexibleAdapter makes it very easy to create RecyclerView based UITableView and UICollectionView-like Android counterparts.
The problem is, I can’t override some methods in the attached project, because I get the Generic parameter doesn’t fulfill constraint compile time error.
I have a class defined as:
public class TableViewHeader: AbstractHeaderItem<TableViewItemHolder>
where I have to override
createViewHolder methods in order to be able to use it.
First, for both methods Fire CC offers me the following definitions:
func bindViewHolder(_ arg1: FlexibleAdapter<IFlexible<VH>!>!, _ arg2: VH!, _ arg3: Int32, _ arg4: List<Object!>!)
func createViewHolder(_ arg1: View!, _ arg2: FlexibleAdapter<IFlexible<VH>!>!) -> VH!
VH kind of makes sense because
IFlexible is defined as:
public interface IFlexible<VH extends RecyclerView.ViewHolder>
However, the compiler complains about
VH being unknown type. IMHO it would make more sense for the CC to replace
VH with TableViewItemHolder given the
TableViewHeader definition above.
This brings us to the second issue. If I replace
TableViewItemHolder, the compiler says
Generic parameter doesn't fulfill constraint which shouldn’t be because
TableViewItemHolder is descendant of
Test project attached.
FlexibleAdapter test.zip (3.8 MB)