         switch (collectionConfiguration.scrollingDirection, delegate) {
         case (.horizontal, .some(let delegate)):
             let inset = delegate.verticalPaddingForHorizontalInfiniteScrollingBehaviour(behaviour: self)
-            return UIEdgeInsetsMake(inset, 0, inset, 0)
+            return UIEdgeInsets(top: inset, left: 0, bottom: inset, right: 0)
         case (.vertical, .some(let delegate)):
             let inset = delegate.horizonalPaddingForHorizontalInfiniteScrollingBehaviour(behaviour: self)
-            return UIEdgeInsetsMake(0, inset, 0, inset)
+            return UIEdgeInsets(top: 0, left: inset, bottom: 0, right: inset)
         case (_, _):
-            return UIEdgeInsetsMake(0, 0, 0, 0)
+            return UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0)
         }
     }
     

    public func scroll(toElementAtIndex index: Int) {
        let boundaryDataSetIndex = indexInBoundaryDataSet(forIndexInOriginalDataSet: index)
        let indexPath = IndexPath(item: boundaryDataSetIndex, section: 0)
        let scrollPosition: UICollectionViewScrollPosition = collectionConfiguration.scrollingDirection == .horizontal ? .left : .top
        collectionView.scrollToItem(at: indexPath, at: scrollPosition, animated: false)
    }
    

}

public struct CollectionViewConfiguration {
    public let scrollingDirection: UICollectionView.ScrollDirection
    public var layoutType: LayoutType
    public static let `default` = CollectionViewConfiguration(layoutType: .numberOfCellOnScreen(5), scrollingDirection: .horizontal)
    
    public init(layoutType: LayoutType, scrollingDirection: UICollectionView.ScrollDirection) {
        self.layoutType = layoutType
        self.scrollingDirection = scrollingDirection
    }
