Latest 0.1.1
License MIT
Platforms ios 8.0

Pop up a custom view from UIViewController, you can custom the pop position, from top, bottom, left, right or center, this will be poped view is created all by yourself, that means you can pop up any view you created and modified or any subclasses inherited form UIView



in the UIViewController you can write this:

    UIView* aView = [[UIView alloc] init];//do anything you want to modify the view...

    [self popCustomView:aView formPosition:ECPopViewFromTop];//then just pop up the view and set the pop position

Customize the mask back ground color

via ec_marskColor property, you can customize the mask back ground color, if you do not set the property for another value before your pop action, it will use the default back color defined in the header file:


#define EC_DEFAULT_MASK_COLOR [UIColor colorWithRed:37/255.0 green:37/255.0 blue:37/255.0 alpha:0.5f]

you can change the defined color for global mask back ground color or set a different color for a indvidual pop-up view, but it will only effect onece


    UIView* aView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 200, 200)];
    aView.backgroundColor = UIColor.redColor;
    //change the pop mask back ground color, but it only effect onece, for next pop it will use the default color
    UIColor* differentColor = [UIColor colorWithRed:88/255.0 green:88/255.0 blue:88/255.0 alpha:0.5f];
    self.ec_marskColor = differentColor;
    [self popCustomView:aView formPosition:ECPopViewFromTop];

Using spring effective

you can determin to use a spring effective animation or just to pop up the view with classic animation


if you want a spring effective, you need to set the spring affective parameter, springVelocity and springDamping


    //no spring effective
    [self popCustomView:aView formPosition:ECPopViewFromTop];
    //with spring effective
    [self popCustomViewSpring:aView formPosition:ECPopViewFromTop springVelocity:1.0 withDamping:0.5];

Config the pop animation duration

you can control the pop animation duration before you pop a view every time


via set the ec_popAnimateDuration property to any value you want to control the pop animation duration, it is a NSNumber property.


    self.ec_popAnimateDuration = [NSNumber numberWithFloat:0.50];
    [self popCustomView:view formPosition:ECPopViewFromBottom];

Latest podspec

    "name": "ECPopView",
    "version": "0.1.1",
    "summary": "Pop a custom view from UIViewController.",
    "description": "Pop a custom view from UIViewController, you can custom the pop position, pop from top, bottom, left, right or center",
    "homepage": "",
    "license": "MIT",
    "authors": {
        "zxwcool": "[email protected]"
    "platforms": {
        "ios": "8.0"
    "source": {
        "git": "",
        "tag": "0.1.1"
    "source_files": [
    "exclude_files": "ECPopView/Exclude"

Pin It on Pinterest

Share This