Latest 0.0.5
Homepage https://github.com/ONECATYU/WSModallyTransition
License MIT
Platforms ios 8.0, requires ARC
Frameworks UIKit, Foundation
Authors
  • 一个类似于系统alterView和actionSheet的模态弹出和消失的转场动画
  • 可用于快速自定义alterView和actionSheet

Usage

1.在storyboard里你可以像这样拖拽并设置好约束  

2.安全区域(safeAreaInsets)
在iOS 11下,会根据safeAreaInsets来调整WSModallyContainerView的subView的上下左右约束的constant,所以你不需要做额外的适配工作. 如下图,在safeAreaInsets改变时,将subView的边界距离,从原始的红色方框区域,调整到右边图中的subView区域。      

3.该viewController需要继承WSModallyViewController.
4.在WSModallyViewController子类中实现WSModallyViewControllerDelegate中的协议方法:

    //返回一个过渡动画控制器,
    - (WSModallyAnimationController *)animationController {
        WSModallyAnimationController *animation = [WSModallyAnimationController new];
        animation.animationStyle = WSModallyAnimationStyleAlert;
        return animation;
    }

    //返回一个需要做动画的containerView,这里你也可以用storyboard拖拽一个,并关联
        //@property (weak, nonatomic) IBOutlet UIView *containerView; 你可以参照Demo

    - (WSModallyContainerView *)containerView {
        return _containerView;
    }

Latest podspec

{
    "name": "WSModallyTransition",
    "version": "0.0.5",
    "summary": "u4e00u4e2au7c7bu4f3cu4e8eu7cfbu7edfalterViewu548cactionSheetu7684u6a21u6001u5f39u51fau548cu6d88u5931u7684u8f6cu573au52a8u753buff0cu53efu7528u4e8eu5febu901fu81eau5b9au4e49alterViewu548cactionSheet.",
    "description": "* u4e00u4e2au7c7bu4f3cu4e8eu7cfbu7edfalterViewu548cactionSheetu7684u6a21u6001u5f39u51fau548cu6d88u5931u7684u8f6cu573au52a8u753bn* u53efu7528u4e8eu5febu901fu81eau5b9au4e49alterViewu548cactionSheetn* u754cu9762u5b8cu5168u53efu81eau5b9au4e49",
    "homepage": "https://github.com/ONECATYU/WSModallyTransition",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "capsule": "[email protected]"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/ONECATYU/WSModallyTransition.git",
        "tag": "0.0.5"
    },
    "source_files": [
        "WSTransition",
        "WSTransition/**/*.{h,m}"
    ],
    "frameworks": [
        "UIKit",
        "Foundation"
    ],
    "requires_arc": true
}

Pin It on Pinterest

Share This