How bohdanorlov/bouncypageviewcontroller works
Project type and purpose
• This is a UI component library (a CocoaPod/Carthage-friendly Swift framework) that wraps Apple’s UIPageViewController to provide a “bounce” interaction effect. It also includes an Example iOS app demonstrating how to integrate and configure the component.
File structure
• Top level:
• BouncyPageViewController.podspec – CocoaPods specification
• BouncyPageViewController/Classes – the framework source code
• BouncyPageViewController/Assets – any bundled images or resources
• Example/… – an Xcode workspace & project showing usage
• GIFs/, README.md, LICENSE, .travis.yml – documentation, CI config, sample animations
• The Example folder contains: AppDelegate, ViewController, storyboard & XIB, image assets, Podfile to pull in the framework, and tests.
README for additional insights
• It shows the public API:
• Init with initial view controllers
• Configure closures for next/previous controller resolution (viewControllerAfterViewController, viewControllerBeforeViewController)
• Configure a scroll callback (didScroll) exposing offset and progress
• It describes adjustable properties: pageContentInset, pageBounceAnimationDuration, overscrollBounceMultiplier.
Main components
a. Hosting iOS App (Example)
b. BouncyPageViewController Framework
• BouncyPageViewController.swift (core logic)
• Assets (if any visual resources are needed at runtime)
c. Apple UIKit Components
• UIPageViewController (underlying engine)
• UIGestureRecognizer for pan/swipe detection
d. Child ViewControllers (your content pages)
Relationships and data flow
• Host App → BouncyPageViewController API
• Initializes with two view controllers
• Supplies closure callbacks to the framework
• Receives scroll events via didScroll for UI updates
• BouncyPageViewController → UIPageViewController
• Acts as dataSource & delegate, forwarding the closure results
• Listens to UIPageViewController’s internal scroll to compute bounce offset & progress
• UIPageViewController → Child ViewControllers
• Presents one or two view controllers at once according to the paging flow
• BouncyPageViewController → Child ViewControllers
• On scroll, invokes didScroll and passes computed metrics so child VCs can animate their own UI
Architectural patterns & techs
• Composition over inheritance: the framework wraps Apple’s UIPageViewController rather than subclassing it
• Closure-based callbacks replacing delegate patterns for next/previous and scroll events
• Modular packaging via CocoaPods / Carthage (podspec file)
• Continuous Integration via Travis CI (.travis.yml)