Skip to content

Latest commit

 

History

History
37 lines (25 loc) · 1.63 KB

README.md

File metadata and controls

37 lines (25 loc) · 1.63 KB

ViewDragger

Version License Platform

Setup forwards superView and backwards superView.Then you can drag view backwards and forwards. This is an alternative to modal viewController with transition animation.

When user drag the animation view, the dragger lifts the view to the window level.When the drag ended, the dragger will place the animation view to the right place.

All you have to care is the backwards view and forwards view. Also backwards frame and forwards frame needs to be set.

Example

let dragger = ViewDragger(animationView: aView, // the view need drag animation
                          backwardsSuperView: aBackwardsSuperView, // the original superview
                          forwardSuperView: aForwardsSuperView, // forwards animation superview
                          backwardsViewFrame: aBackwardsFrame, // the orginal frame
                          forwardsViewFrame: aForwardsFrame, // forwards animation end frame
                          gestureAxis: .horizontal) // or .vertical

Installation

ViewDragger is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'ViewDragger'

License

ViewDragger is available under the MIT license. See the LICENSE file for more info.