RappleUIAnimator 0.2.0

RappleUIAnimator 0.2.0

测试已测试
语言语言 Obj-CObjective C
许可 MIT
发布最新发布2015 年 8 月

Rapple UI Animator 维护。



  • 作者
  • Rajeev Prasad

用于基于 UIView 和 UIViewController 的动画的简单易用的动画库

要求

部署目标 - iOS 8.0 或更高版本

安装

RappleUIAnimator 通过 CocoaPods 提供。要安装它,只需将以下行添加到您的 Podfile 中

pod "RappleUIAnimator"

作者

Rajeev Prasad,[email protected]

许可

RappleUIAnimator 可在 MIT 许可下使用。有关更多信息,请参阅 LICENSE 文件。

使用方法

Objc ->

    #import <RappleUIAnimator/RappleUIAnimator.h> 

Swift ->

    import RappleUIAnimator
Rapple 模态显示动画器

首先添加一个全局变量以保持 RappleTransitionDelegate

    var transitionDelegate : RappleTransitionDelegate?

然后创建您的视图控制器,在显示之前设置 transitioningDelegate

        if let vc = UIStoryboard(name: "Main", bundle: nil).instantiateViewControllerWithIdentifier("ModalViewController") as? ModalViewController {
            transitionDelegate = RappleTransitionDelegate(viewController: vc, direction: RappleDirectionLeftToRight);
            vc.transitioningDelegate = transitionDelegate
            self.presentViewController(vc, animated: true, completion: nil)
        }

alt tag

Rapple 提示视图

使用消息和按钮标题及完成处理程序打开提示视图

        let alert = RappleAlertView(message: "Rapple alert view is awsome!!!", cancel: "Cancel", ok: "OK");
        alert.setAttributes([RappleAlertButtonTextColor : UIColor.whiteColor(), RappleAlertButtonPanelColor : RappleColor.rappleBlue()])
        alert.show { (button) -> Void in
            if button.value ==  RappleAlertCancelButton.value {
                println("Cancel Tapped") ;
            } else if button.value == RappleAlertOKButton.value {
                println("OK Tapped")
            }
        }

alt tag

Rapple 弹出视图

首先添加一个全局变量以保持 RapplePOPView

    var pop : RapplePOPView? 

然后创建您的视图控制器,并用 RapplePOPView 设置和打开

        if let vc = UIStoryboard(name: "Main", bundle: nil).instantiateViewControllerWithIdentifier("RapplePOPViewController") as? RapplePOPViewController {
            vc.popDelegate = self
            pop = RapplePOPView(customViewController: vc, size: CGSizeMake(300, 400))
            pop!.delegate = self
            pop!.setBorderColor(UIColor.lightGrayColor(), borderWidth: 2)
            pop!.show()
        }

alt tag