Lightweight library to and example project to build beautiful parallaxing onbaording slides. Achive onboarding slides that have depth effect when in motion in a few simple steps.
This project is maintained by Tapptitude, a mobile app development agency specialized in building high-quality iOS and Android mobile apps, for startups and brands alike. A lively team of skilled app developers and app designers based in Europe, we provide full-stack mobile app development services to entrepreneurs looking to innovate on mobile.
- iOS 11.0+
- Xcode 10.0+
Xcode
> File
> Swift Packages
> Add Package Dependency...
> Paste
https://github.com/tapptitude/TTParallaxOnboarding
Add the contents of Sources/TTParallaxOnboarding folder to your project.
Best way to understand how to use the library is to clone and open the example project.
-
Build your art view in a single container view but keep the slides organized into a horizontal stack view. See
OboardingView
in the example project. -
Create an
TTParallaxScrollView
either from code using the interface builder. -
Add the art view to the scrollview
let onboardingView = OnboardingView()
scrollView.set(contentView: onboardingView, pageCount: 3)
- Assign a depth to each of your layer view. The depth value needs to be betwen 0.0 and 1.0. The greater the value is the farther the object will look when scrolling. For example some distant mountains would be 0.9 and somehting just in front of the scene will be 0.0 (this will scroll at the same rate with the ScrollView).
self.scrollView.addParallax(to: onboardingView.rocket, depth: 0.4)
self.scrollView.addParallax(to: onboardingView.mountain, depth: 0.7)
If you want something to reamin stationary assign it the value of 1.0.
Feel free to Fork, submit Pull Requests or send us your feedback and suggestions!
TTParallaxOnboarding is available under the MIT license. See the LICENSE file for more info.