测试已测试 | ✗ |
Lang语言 | SwiftSwift |
许可证 | MIT |
已发布上次发布 | 2015年8月 |
SPM支持 SPM | ✗ |
由 Takuya Okamoto 维护。
灵感来自 https://dribbble.com/shots/1945593-Login-Home-Screen
我创建了一个带加载动画和过渡动画的 Animated UIButton。
如以下 GIF 动画演示所示,您可以找到 "登录" 按钮滚动,然后下一个 UIViewController 将淡入。
我将它们做成类,您可以轻松使用它们。
pod 'TKSubmitTransition'
btn = TKTransitionSubmitButton(frame: CGRectMake(0, 0, 44, 44))
func didStartYourLoading() {
btn.startLoadingAnimation()
}
func didFinishYourLoading() {
btn.startFinishAnimation {
//Your Transition
let secondVC = SecondViewController()
secondVC.transitioningDelegate = self
self.presentViewController(secondVC, animated: true, completion: nil)
}
}
此库还提供了一个 UIViewControllerAnimatedTransitioning
的淡入动画类。
请使用此类进行动画过渡。
class ViewController: UIViewController, UIViewControllerTransitioningDelegate {
secondVC.transitioningDelegate = self
// MARK: UIViewControllerTransitioningDelegate
func animationControllerForPresentedController(presented: UIViewController, presentingController presenting: UIViewController, sourceController source: UIViewController) -> UIViewControllerAnimatedTransitioning? {
let fadeInAnimator = TKFadeInAnimator()
return fadeInAnimator
}
func animationControllerForDismissedController(dismissed: UIViewController) -> UIViewControllerAnimatedTransitioning? {
return nil
}