diff --git a/Sources/Core/CollectionView.swift b/Sources/Core/CollectionView.swift index 8295eb8..8b81557 100644 --- a/Sources/Core/CollectionView.swift +++ b/Sources/Core/CollectionView.swift @@ -14,8 +14,9 @@ open class CollectionView: UICollectionView, AccessorView whe public typealias Source = T public let source = T() - public required init() { - super.init(frame: .zero, collectionViewLayout: CollectionViewSource.defaultLayout) + public required override init(frame: CGRect = .zero, collectionViewLayout layout: UICollectionViewLayout? = nil) { + let layout = layout ?? CollectionViewSource.defaultLayout + super.init(frame: frame, collectionViewLayout: layout) source.containerView = self }