HWPanModal is used to present controller and drag to dismiss.
Inspired by PanModal, thanks.
- Supports any type of
UIViewController
- Seamless transition between modal and content
- Support two kinds of GestureRecognizer
- UIPanGestureRecognizer, direction is UP & Down.
- UIScreenEdgePanGestureRecognizer, you can swipe on screen edge to dismiss controller.
iOS 8.0+, support Objective-C & Swift.
Because Objective-C KVO is hard to use, so I use KVOController = =
pod 'HWPanModal', '~> 0.2.6.2'
Your UIViewController need to conform HWPanModalPresentable
. If you use default, nothing more will be written.
More custom config animation & UI, pls check HWPanModalPresentable.h
file.
#import <HWPanModal/HWPanModal.h>
@interface HWBaseViewController () <HWPanModalPresentable>
@end
@implementation HWBaseViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
}
@end
Where you need to present this Controller.
#import <HWPanModal/HWPanModal.h>
[self presentPanModal:[HWBaseViewController new]];
yeah! Easy.
- Clone this git.
- open the terminal, go to the
Example
Folder. pod install --verbose
- Double click HWPanModal.xcworkspace, and run.
-
0.2.0 Add screen edge interactive gesture. Default this function is closed, implement
- (BOOL)allowScreenEdgeInteractive;
to config it.- (BOOL)allowScreenEdgeInteractive { return YES; }
-
0.2.1
- Fix when rotate presented controller, the UI is not correct.
-
0.2.2
- Screen edge pan interactive bug fix.
-
0.2.3
- iOS8+ rotate bug fix.
-
0.2.4
- UI bug fix.
- Improve drag indicator animate.
- Add
- (BOOL)allowsTapBackgroundToDismiss;
to control whether can tap background to dismiss.
-
0.2.5
- file name update.
-
0.2.6
- Add
- (BOOL)shouldAnimatePresentingVC;
to config transition for PresentingVC.
- Add
-
0.2.6.1
- fix when set UIScrollView contentOffset in
- (void)viewDidLoad;
cause first pan UI issue.
- fix when set UIScrollView contentOffset in
HWPanModal is released under a MIT License. See LICENSE file for details.