Giter VIP home page Giter VIP logo

popview's Introduction

YYPopView

自定义转场动画展现PopView

License MIT Wercker  CocoaPods

介绍:

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

微信的长这个样子

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

用法:

Cocoapod:

pod 'YYPopView', '~> 0.0.1'

手动:

Resource文件夹拖入到工程中

具体使用方法:

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

     @IBAction func didClickedLeftButton() {
         modalPopView(PopViewType.Left)
     }
    
     @IBAction func didClickedCenterButton() {
         modalPopView(PopViewType.Center)
     }
    
    
     @IBAction func didClickeRightButton() {
         modalPopView(PopViewType.Right)
     }
    
  2. 遵守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)
     }    
    
  3. 代理方法的实现

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

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

声明:

  1. 已适配3.5inch~5.5inch.
  2. iOS8以上可用,iOS8以下没测试过.
  3. 有问题随时issue或者邮箱heisenbean.me@gmail联系我.

popview's People

Contributors

heisenbean avatar botheast avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.