Main Componenets
PagedCollectionView
- Uses
PagedCollectionViewLayout
to layout the cells during rotation. - Adds the
UICollectionView
inside aUIView
to enable the paging support.
- Uses
PagedCollectionViewLayout
- Arrange the items to be displayed in full collection view size and adjust its size during rotation.
- Available customizations:
pageSpacing: CGFloat
: Spacing between the pages that is only visible during scrollingpageInset: UIEdgeInsets
: The insets for each individual pagecollectionViewInset: UIEdgeInsets
: Insets for the collection view area that is not visible, helpful when the collection view size is bigger than its superview. Used to enable paging support with spaces between pages.shouldRespectAdjustedContentInset: Bool
: When set tofalse
-> the items will fill the whole available spacescrollDirection: UICollectionView.ScrollDirection
: The direction of scrollinghorizontal
orvertical
CenteredItemCollectionViewFlowLayout
- Scrolls the collectionView during rotation to show the same item that was visible before rotation
- Available customizations (Check
CenteredItemLocatingDelegate
):- Center of the collection view
- Cells to exclude during calculation
- Ability to reject scrolling
Handy classes to provide a data source for a collection view
Just create an instance of SectionConfigurator
with the ViewModels
and asign the dataSource to the collection view
MIT License
Copyright (c) 2019 Hani Ibrahim
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.