Home

Awesome

CollectionViewPagingLayout - PagingView for SwiftUI

License platforms pod Carthage compatible Swift Package Manager compatible

Previews

Layout Designer

<img width="600" src="https://amir.app/git/layout_designer_preview.gif">
<a href="https://apps.apple.com/nl/app/layout-designer/id1507238011?l=en&mt=12"> <img width="100" src="http://amir.app/git/app_store.png"></img> </a>

Custom implementations, UIKit: TransformableView, SwiftUI: TransformPageView

Click on image to see the code

<p float="left">

<img width="120" src="https://amir.app/git/flowlayout_preview.gif"> <img width="120" src="https://amir.app/git/gallery_preview.gif"> <img width="120" src="https://amir.app/git/cards_preview.gif"> <img width="120" src="https://amir.app/git/devices.gif"> <img width="120" src="https://amir.app/git/weather.gif">

<p />

UIKit: SnapshotTransformView, SwiftUI: SnapshotPageView

<p float="left">

<img width="100" src="https://amir.app/git/shapes_preview/snapshot_grid.gif"> <img width="100" src="https://amir.app/git/shapes_preview/snapshot_space.gif"> <img width="100" src="https://amir.app/git/shapes_preview/snapshot_chess.gif"> <img width="100" src="https://amir.app/git/shapes_preview/snapshot_tiles.gif"> <img width="100" src="https://amir.app/git/shapes_preview/snapshot_lines.gif"> <img width="100" src="https://amir.app/git/shapes_preview/snapshot_bars.gif"> <img width="100" src="https://amir.app/git/shapes_preview/snapshot_puzzle.gif"> <img width="100" src="https://amir.app/git/shapes_preview/snapshot_fade.gif">

</p>

UIKit: ScaleTransformView, SwiftUI: ScalePageView

<p float="left">

<img width="100" src="https://amir.app/git/shapes_preview/scale_invertedcylinder.gif"></img> <img width="100" src="https://amir.app/git/shapes_preview/scale_cylinder.gif"></img> <img width="100" src="https://amir.app/git/shapes_preview/scale_coverflow.gif"></img> <img width="100" src="https://amir.app/git/shapes_preview/scale_rotary.gif"></img> <img width="100" src="https://amir.app/git/shapes_preview/scale_linear.gif"></img> <img width="100" src="https://amir.app/git/shapes_preview/scale_easein.gif"></img> <img width="100" src="https://amir.app/git/shapes_preview/scale_easeout.gif"></img> <img width="100" src="https://amir.app/git/shapes_preview/scale_blur.gif"></img>

</p>

UIKit: StackTransformView, SwiftUI: StackPageView

<p float="left">

<img width="100" src="https://amir.app/git/shapes_preview/stack_transparent.gif"></img> <img width="100" src="https://amir.app/git/shapes_preview/stack_blur.gif"></img> <img width="100" src="https://amir.app/git/shapes_preview/stack_perspective.gif"></img> <img width="100" src="https://amir.app/git/shapes_preview/stack_reverse.gif"></img> <img width="100" src="https://amir.app/git/shapes_preview/stack_rotary.gif"></img> <img width="100" src="https://amir.app/git/shapes_preview/stack_vortex.gif"></img>

</p>

About

UIKit:
A simple but powerful framework that lets you make complex layouts for your UICollectionView.
The implementation is quite simple. Just a custom UICollectionViewLayout that gives you the ability to apply transforms to the cells.
No UICollectionView inheritance or anything like that.

SwiftUI:
A simple View that lets you make page-view effects.
Powered by UICollectionView

<br>

For more details, see How to use

Installation

This framework doesn't contain any external dependencies.

CocoaPods

# Podfile
use_frameworks!

target 'YOUR_TARGET_NAME' do
    pod 'CollectionViewPagingLayout'
end

Replace YOUR_TARGET_NAME and then, in the Podfile directory, type:

$ pod install

Carthage

Add this to Cartfile

github "CollectionViewPagingLayout"

and then, in the Cartfile directory, type:

$ carthage update

Swift Package Manager

using Xcode:

File > Swift Packages > Add Package Dependency

Manually

Just add all the files under Lib directory to your project

How to use

Using Layout Designer

There is a macOS app to make it even easier for you to build your custom layout.
It allows you to tweak many options and see the result in real-time.
It also generates the code for you. So, you can copy it to your project.

You can purchase the app from App Store and support this repository, or you can build it yourself from the source.
Yes, the macOS app is open-source too!.

Continue for SwiftUI or UIKit

Limitations

Credit

License

CollectionViewPagingLayout is available under the MIT license. See LICENSE file for more info.