Latest 0.0.2
Homepage https://github.com/Heisenbean/PopView
License MIT
Platforms ios 8.0, requires ARC
Authors

自定义转场动画展现PopView

License MIT  CocoaPods ![CocoaPods]( https://img.shields.io/badge/Swift-4.0-orange.svg)

介绍:

这种效果类似微信右上角的弹窗,但不同的是,PopView加了转场动画,这样看上去更酷一点.

微信的长这个样子

我的目前看起来是这个样子


用法:

Cocoapod:

pod 'YYPopView', '~> 0.0.2'

手动:

Resource文件夹拖入到工程中

具体使用方法:

  1. 选择popView的展现位置左,中,右

@IBAction func didClickedLeftButton() {
modalPopView(PopViewType.Left)
}

@IBAction func didClickedCenterButton() {
modalPopView(PopViewType.Center)
}

@IBAction func didClickeRightButton() {
modalPopView(PopViewType.Right)
}

  1. 遵守popView的两个代理方法

func modalPopView(type:PopViewType){
let popVc = PopViewController()
popVc.popType = type
popVc.transitioningDelegate = animationDelegate
popVc.modalPresentationStyle = UIModalPresentationStyle.Custom
popVc.selectDelegate = self
animationDelegate.popViewType = type
presentViewController(popVc, animated: true, completion: nil)
}

  1. 代理方法的实现

extension ViewController:DidSelectPopViewCellDelegate{
func didSelectRowAtIndexPath(indexPath: NSIndexPath) {
print("点击了第(indexPath.row)个")
}
}

具体实例请下载项目,参照ViewController

声明:

  1. 已适配3.5inch~5.5inch以及iPhone X.
  2. 有问题随时issue或者邮箱[email protected]联系我.

Latest podspec

{
    "name": "YYPopView",
    "version": "0.0.2",
    "summary": "A Sample PopView on iOS.",
    "homepage": "https://github.com/Heisenbean/PopView",
    "license": "MIT",
    "authors": {
        "Heisenbean": "[email protected]"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/Heisenbean/PopView.git",
        "tag": "0.0.2"
    },
    "source_files": "PopView/Resource/*.swift",
    "pod_target_xcconfig": {
        "SWIFT_VERSION": "4.0"
    },
    "requires_arc": true
}

Pin It on Pinterest

Share This