Skip to content

Commit

Permalink
Still check info, but not data
Browse files Browse the repository at this point in the history
Headers and footers can have null/no data but they should still have info
  • Loading branch information
Redth committed Jun 7, 2024
1 parent 8d504c4 commit 137e2af
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions VirtualListView/Apple/CvDataSource.ios.maccatalyst.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,23 +70,19 @@ public override UICollectionViewCell GetCell(UICollectionView collectionView, NS
info.IsSelected = false;
else
info.IsSelected = Handler?.IsItemSelected(info.SectionIndex, info.ItemIndex) ?? false;
}

if (cell.NeedsView)
{
var view = Handler?.PositionalViewSelector?.ViewSelector?.CreateView(info, data);
if (view is not null)
cell.SetupView(view);
}

if (cell.NeedsView)
{
var view = Handler?.PositionalViewSelector?.ViewSelector?.CreateView(info, data);
if (view is not null)
cell.SetupView(view);
}

if (info is not null)
{
cell.UpdatePosition(info);

if (data is not null && (cell.VirtualView?.TryGetTarget(out var cellVirtualView) ?? false))
if (cell.VirtualView?.TryGetTarget(out var cellVirtualView) ?? false)
{
Handler?.PositionalViewSelector?.ViewSelector?.RecycleView(info, data, cellVirtualView);

Handler?.VirtualView?.ViewSelector?.ViewAttached(info, cellVirtualView);
}
}
Expand Down

0 comments on commit 137e2af

Please sign in to comment.