Skip to content

HWPanModal is used to present controller from bottom and drag to dismiss.

License

Notifications You must be signed in to change notification settings

WYStudioEx/HWPanModal

 
 

Repository files navigation

HWPanModal 👍

HWPanModal is used to present controller and drag to dismiss.

Inspired by PanModal, thanks.

中文文档说明

Snapshoot

Features

  1. Supports any type of UIViewController
  2. Seamless transition between modal and content
  3. Support two kinds of GestureRecognizer
    1. UIPanGestureRecognizer, direction is UP & Down.
    2. UIScreenEdgePanGestureRecognizer, you can swipe on screen edge to dismiss controller.

Compatibility

iOS 8.0+, support Objective-C & Swift.

Dependency

KVOController - facebook

Because Objective-C KVO is hard to use, so I use KVOController = =

Installation

CocoaPods

pod 'HWPanModal', '~> 0.2.6.2'

How to use

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.

Example

  1. Clone this git.
  2. open the terminal, go to the Example Folder.
  3. pod install --verbose
  4. Double click HWPanModal.xcworkspace, and run.

Contact Me

[email protected]

Change Log

  • 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.
  • 0.2.6.1

    • fix when set UIScrollView contentOffset in - (void)viewDidLoad; cause first pan UI issue.

License

HWPanModal is released under a MIT License. See LICENSE file for details.

About

HWPanModal is used to present controller from bottom and drag to dismiss.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Objective-C 98.5%
  • Ruby 1.5%