Skip to content

Commit

Permalink
Fix issue conditional binding error.
Browse files Browse the repository at this point in the history
Fixes #1.
  • Loading branch information
ocollet committed Dec 20, 2023
1 parent d05515e commit e3b9f5c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Sources/LazyCollectionView/LazyCollectionView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ where Data: RandomAccessCollection & Equatable,
let attributes = layout.layoutAttributesForElements(in: visibleRect)
ZStack {
ForEach(attributes) { attributes in
if attributes.index < data.count, let element = data[attributes.index] {
if attributes.index < data.count {
let element = data[attributes.index]
content(element)
.frame(width: attributes.frame.size.width, height: attributes.frame.size.height)
.position(CGPoint(x: attributes.frame.midX, y: attributes.frame.midY))
Expand Down

0 comments on commit e3b9f5c

Please sign in to comment.