- August 28, 2025
- Mins Read
Page view controller with bounce effect inspired by motion design by Stan Yakushevish.
![]()
|
|---|
UIViewControllers to display
let pagesQueue: [UIViewController]() = … // your view controllers here
BouncyPageViewController passing initial view controllers
let pageViewController = BouncyPageViewController(initialViewControllers: Array(pagesQueue[0…1]))
pageViewController.viewControllerAfterViewController = self.viewControllerAfterViewController
pageViewController.viewControllerBeforeViewController = self.viewControllerBeforeViewController
func viewControllerAfterViewController(prevVC: UIViewController) -> UIViewController? {
if let idx = self.pagesQueue.index(of: prevVC), idx + 1 < self.pagesQueue.count {
return self.pagesQueue[idx + 1]
}
return nil
}
didScroll callback closure
pageViewController.didScroll = self.pageViewControllerDidScroll
offset and progress
func pageViewControllerDidScroll(pageViewController: BouncyPageViewController, offset: CGFloat, progress: CGFloat) {
for vc in pageViewController.visibleControllers() {
let vc = (vc as! ViewController)
vc.progress = progress
}
}
public var pageContentInset: CGFloat = 30
public var pageBounceAnimationDuration: TimeInterval = 1
public var overscrollBounceMultiplier: CGFloat = 0.5
$ pod install
and run as usual.
git “https://github.com/BohdanOrlov/BouncyPageViewController”
Then run in terminal:
$ carthage update
pod “BouncyPageViewController”
Due to Swift 3, you have to add this to the end of Podfile:
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings[‘SWIFT_VERSION’] = ‘3.0’
end
end
end
This package provides you with an easy way to show tooltips over any SwiftUI view, since Apple does not provide ...
SimpleToast is a simple, lightweight, flexible and easy to use library to show toasts / popup notifications inside iOS or ...
Create Toast Views with Minimal Effort in SwiftUI Using SSToastMessage. SSToastMessage enables you to effortlessly add toast notifications, alerts, and ...