文章来源:淘论文网   发布者: 毕业设计   浏览量: 29



还可以点击去查询以下关键词:
[AZTransitions]    [AZTransitions]   

项目介绍:

AZTransitions

https://github.com/azimin/AZTransitions

Make your modal transition with custom animation.
AZTransitions helps you think about creativity, giving specific API methods.

AZTransitions 使用自定义动画进行模态转换。提供具体的API方法。

Visual Example

Installation

Add the following to your Podfile and run pod install

pod 'AZTransitions'

or add the following to your Cartfile and run carthage update

github 'azimin/AZTransitions'

or clone as a git submodule,

or just copy AZTransitions/Source/CustomModalTransition.swift into your project.

Code Example

To create any custom transition just subclass CustomModalTransition:

class FashionTransition: CustomModalTransition { override init() { super.init(duration: 0.5) } }

--

Then set as az_modalTransition to nessesary view just before presenting it

override func prepare(for segue: UIStoryboardSegue, sender: Any?) { segue.destination.customModalTransition = FashionTransition() }

or

func show() { let viewController = UIViewController() viewController.az_modalTransition = FashionTransition() self.present(viewController, animated: true, completion: nil) }

--

To have custom present animation, just implement performTransition(interactive: Bool) inside your FashionTransition class:

func performTransition(interactive: Bool) { self.presentedViewController.view.alpha = 0.0 UIView.animate(withDuration: duration, animations: { self.presentedViewController.view.alpha = 1.0 self.presentingViewController.view.alpha = 0.0 }, completion: { (completed) in self.presentingViewController.view.alpha = 1.0 self.finishAnimation(completion: nil) }) }

As you may have guessed, you have different properties. The main ones:

duration — transition duration

presentingViewController — the presenting view controller (bottom one)

presentedViewController — view controller that is going to be presented (top one)

You can animate them as you want.

开题报告开题报告


这里还有:


还可以点击去查询:
[AZTransitions]    [AZTransitions]   

请扫码加微信 微信号:sj52abcd


下载地址: http://www.taolw.com/down/7996.docx
  • 上一篇:HLNet毕业设计working
  • 下一篇:DPColorfu定制lTags-Swift