12345678910111213141516171819202122232425262728 |
- import UIKit
- struct SideAnimator: PresentAnimatable {
- func contentViewAppearAnimation(duration: TimeInterval, in view: UIView) {
- let animation = CATransition()
- animation.duration = duration
- animation.type = .moveIn
- animation.subtype = .fromLeft
- view.layer.add(animation, forKey: nil)
- }
- func contentViewDisappearAnimation(duration: TimeInterval, in view: UIView) {
- UIView.animate(withDuration: duration) {
- view.center = CGPoint(x: view.center.x - view.bounds.width, y: view.center.y)
- }
- }
- }
|