Spring Animation Library - Deployment and Usage Guide
1. Prerequisites
- Xcode 10 or later (required for Swift 4.2 support)
- iOS 8.0 or later (minimum deployment target)
- Swift 4.2 (required for this version)
2. Installation
Manual Installation
- Download the Spring library from GitHub
- Drag the
Springfolder into your Xcode project - Ensure "Copy items if needed" and "Create groups" are selected
CocoaPods Installation
Add the following to your Podfile:
use_frameworks!
pod 'Spring', :git => 'https://github.com/MengTo/Spring.git'
Then run:
pod install
3. Configuration
Storyboard Configuration
- Select your UIView in the Storyboard
- Open the Identity Inspector
- Change the class to
SpringView - Configure animation properties in the Attribute Inspector
Code Configuration
No additional configuration required. Simply import Spring and use the provided methods.
4. Build & Run
Local Development
- Import Spring in your Swift file:
import Spring
- Configure your view:
layer.animation = "squeezeDown"
layer.animate()
Available Animations
- shake, pop, morph, squeeze, wobble, swing
- flipX, flipY, fall, squeezeLeft, squeezeRight
- squeezeDown, squeezeUp, slideLeft, slideRight
- slideDown, slideUp, fadeIn, fadeOut
- fadeInLeft, fadeInRight, fadeInDown, fadeInUp
- zoomIn, zoomOut, flash
Animation Properties
force: CGFloat (default: 1)duration: CGFloat (default: 1)delay: CGFloat (default: 0)damping: CGFloat (default: 0.7)velocity: CGFloat (default: 0.7)repeatCount: Floatscale: CGFloatx: CGFloaty: CGFloatrotate: CGFloat
Animation Curves
- spring, linear, easeIn, easeOut, easeInOut
5. Deployment
Distribution
- App Store: Build and submit your app normally through Xcode
- Enterprise Distribution: Use your enterprise certificate and provisioning profile
- Ad Hoc: Use ad hoc provisioning for testing
Requirements
- Ensure all Spring animations are properly tested on target devices
- Verify that animations work correctly with your app's UI elements
- Test on different screen sizes and iOS versions
6. Troubleshooting
Common Issues
Issue: Animations won't autostart when view is reached via performSegueWithIdentifier
Solution: Manually trigger animations in viewDidAppear instead of relying on autostart.
Issue: Animations not working in Objective-C projects Solution: Follow the integration guide: Using Swift in Objective-C Projects
Issue: Properties not working together Solution: Not all properties work together. Test with the demo app to find compatible combinations.
Issue: Autostart not working
Solution: Use autostart only when you don't plan to start animations in code. For programmatic control, set autostart to false.
Performance Tips
- Use appropriate animation durations (typically 0.5-1.0 seconds)
- Avoid excessive use of complex animations on low-end devices
- Test animations on actual devices, not just simulators
Known Limitations
- Some properties may conflict with each other
- Complex animations may affect performance on older devices
- Autostart has limitations with storyboard segues