Parchment v2.0.0 Release Notes

Release Date: 2020-08-02 // over 3 years ago
  • ๐Ÿš€ This version introduces a couple of breaking changes that are outlined below. If you're having issues upgrading or you see other breaking changes that are not outlined below, please let us know. More details about the release can be found here: #243.

    โœ‚ Removed FixedPagingViewController

    ๐Ÿšš FixedPagingViewController has been removed. You can now initialize PagingViewController directly with an array of view controllers.

    -FixedPagingViewController(viewControllers: viewControllers)+PagingViewController(viewControllers: viewControllers)
    

    โœ‚ Removed generics (#285)

    ๐Ÿšš PagingViewController is not longer generic on the PagingItem type. This means that all places where you previously had to specify the generic type, or cast to generic type, can be removed.

    -PagingViewController\<CalendarItem\>()+PagingViewController()
    
    -func pagingViewController\<T\>(\_ pagingViewController: PagingViewController\<T\>, pagingItemForIndex index: Int) -\> T {- return PagingIndexItem(index: index, title: cities[index]) as! T-}+func pagingViewController(\_: PagingViewController, pagingItemAt index: Int) -\> PagingItem {+ return PagingIndexItem(index: index, title: cities[index])+}
    

    ๐Ÿšš Moved size delegate into separate protocol

    ๐Ÿšš The widthForPagingItem delegate method have been moved out of the PagingViewControllerDelegate and into a separate protocol called PagingViewControllerSizeDelegate. You now need to set the sizeDelegate property on PagingViewController:

    -pagingViewController.delegate = self+pagingViewController.sizeDelegate = self
    

    Replaced menuItemSource with register(cellClass:)

    ๐Ÿšš The menuItemSource property for customizing the cell type has been removed. Instead you can customize the cell type for a given PagingItem by using register(cellClass:) and register(nib:). The benefit of this approach is that we can support multiple cell types in the same menu (#390).

    - pagingViewController.menuItemSource = .class(type: CalendarPagingCell.self)+ pagingViewController.register(CalendarPagingCell.self, for: CalendarItem.self)
    

    โšก๏ธ Updated naming of data sources

    โšก๏ธ As well as removing generics from the data sources, the naming has also been updated to be a bit more Swift-y.

    protocol PagingViewControllerDataSource: class {- func numberOfViewControllers\<T\>(in pagingViewController: PagingViewController\<T\>) -\> Int+ func numberOfViewControllers(in pagingViewController: PagingViewController) -\> Int- func pagingViewController\<T\>(\_ pagingViewController: PagingViewController\<T\>, viewControllerForIndex index: Int) -\> UIViewController+ func pagingViewController(\_: PagingViewController, viewControllerAt index: Int) -\> UIViewController- func pagingViewController\<T\>(\_ pagingViewController: PagingViewController\<T\>, pagingItemForIndex index: Int) -\> T+ func pagingViewController(\_: PagingViewController, pagingItemAt index: Int) -\> PagingItem} protocol PagingViewControllerInfiniteDataSource: class {- func pagingViewController\<T\>(\_ pagingViewController: PagingViewController\<T\>, viewControllerForPagingItem: T) -\> UIViewController+ func pagingViewController(\_: PagingViewController, viewControllerFor pagingItem: PagingItem) -\> UIViewController- func pagingViewController\<T\>(\_ pagingViewController: PagingViewController\<T\>, pagingItemBeforePagingItem: T) -\> T?+ func pagingViewController(\_: PagingViewController, itemBefore pagingItem: PagingItem) -\> PagingItem?- func pagingViewController\<T\>(\_ pagingViewController: PagingViewController\<T\>, pagingItemAfterPagingItem: T) -\> T?+ func pagingViewController(\_ : PagingViewController, itemAfter pagingItem: PagingItem) -\> PagingItem?}