- iOS 11.0 +
In your Podfile
pod 'FYDraggableView'
Get busy Dragging
#import "UIView+FYDraggable.h"
- (instancetype)initWithFrame:(CGRect)frame
{
if (self = [super initWithFrame:frame]) {
self.fy_draggable = YES;
self.fy_draggablePanGestureRecognizerView = self; // default
}
return self;
}
You can provide your personal configuration
FYDraggableViewConfiguration *configuration = [FYDraggableViewConfiguration configurationWithDirection:FYDraggableViewDirectionAll
position:FYDraggableViewPositionLeft];
configuration.recognizerContentInsets = UIEdgeInsetsMake(5, 5, 5, 10);
configuration.extraContentInsets = UIEdgeInsetsMake(0, 0, 0, -56);
self.fy_draggableViewConfiguration = configuration;
self.fy_draggableViewDelegate = self;
- (void)fy_draggableViewDidDrag:(UIView *)view;
- (void)fy_draggableViewWillBeginDragging:(UIView *)view;
- (void)fy_draggableViewWillEndDragging:(UIView *)view targetCenter:(inout CGPoint)targetCenter;
- (void)fy_draggableViewDidEndDragging:(UIView *)view willDecelerate:(BOOL)decelerate;
- (void)fy_draggableViewWillBeginDecelerating:(UIView *)view;
- (void)fy_draggableViewDidEndDecelerating:(UIView *)view;