Skip to content

Commit

Permalink
add support
Browse files Browse the repository at this point in the history
  • Loading branch information
CalvinChangCC committed Jun 26, 2024
1 parent 1b380a5 commit 4b5d4d5
Showing 1 changed file with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,15 @@ open class SingleSectionCollectionViewAdapter: NSObject, CollectionViewAdapter {
collectionView.dragDelegate = self
collectionView.dropDelegate = self
}
if #available(iOS 13.0, *),
let layout = collectionView.collectionViewLayout as? SectionKitCompositionalLayout {
layout.sections = { [weak self] in
guard let section = self?.collectionViewSection else {
return []
}
return [section]
}
}
}

/**
Expand Down Expand Up @@ -86,6 +95,15 @@ open class SingleSectionCollectionViewAdapter: NSObject, CollectionViewAdapter {
collectionView.dragDelegate = self
collectionView.dropDelegate = self
}
if #available(iOS 13.0, *),
let layout = collectionView.collectionViewLayout as? SectionKitCompositionalLayout {
layout.sections = { [weak self] in
guard let section = self?.collectionViewSection else {
return []
}
return [section]
}
}
}

public let context: CollectionViewContext
Expand Down

0 comments on commit 4b5d4d5

Please sign in to comment.