CollectionViewPagingLayout
A simple but highly customizable UICollectionViewLayout for UICollectionView -- Simple SwiftUI views that let you make page-view effects.
Install / Use
/learn @amirdew/CollectionViewPagingLayoutREADME
CollectionViewPagingLayout - PagingView for SwiftUI
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
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!.
Limitations
-
Specify the number of visible items:
You need to specify the number of visible items.
Since this layout gives you the flexibility to show the next and previous cells,
By default, it loads all of the cells in the collectionview's frame, which means iOS keeps all of them in the memory.
Based on your design, you can specify the number of items that you need to show. -
It doesn't support RTL layouts:
however, you can achieve a similar result by tweaking options, for instance tryStackTransformViewOptions.Layout.reverse
Credit
- DevicesView inspired by this Cuberto's post
Related Skills
pestel-analysis
Analyze political, economic, social, technological, environmental, and legal forces
next
A beautifully designed, floating Pomodoro timer that respects your workspace.
product-manager-skills
41PM skill for Claude Code, Codex, Cursor, and Windsurf: diagnose SaaS metrics, critique PRDs, plan roadmaps, run discovery, and coach PM career transitions.
snap-vis-manager
The planning agent for the snap-vis project. Coordinates other specialized agents and manages the overall project roadmap.
