From b60076d5211f7c2f462d89253ae89c656fff9fbc Mon Sep 17 00:00:00 2001 From: nixzhu Date: Mon, 15 Aug 2016 15:30:19 +0800 Subject: [PATCH] add motionEffect in About --- Yep/Extensions/UIMotionEffect+Yep.swift | 2 +- Yep/ViewControllers/About/AboutViewController.swift | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Yep/Extensions/UIMotionEffect+Yep.swift b/Yep/Extensions/UIMotionEffect+Yep.swift index d0e5ef0ae..de4631f8b 100644 --- a/Yep/Extensions/UIMotionEffect+Yep.swift +++ b/Yep/Extensions/UIMotionEffect+Yep.swift @@ -22,7 +22,7 @@ extension UIInterpolatingMotionEffectType { extension UIMotionEffect { - class func twoAxesShift(strength: Float) -> UIMotionEffect { + class func yep_twoAxesShift(strength: Float) -> UIMotionEffect { func motion(type: UIInterpolatingMotionEffectType) -> UIInterpolatingMotionEffect { let keyPath = type.yep_centerKeyPath diff --git a/Yep/ViewControllers/About/AboutViewController.swift b/Yep/ViewControllers/About/AboutViewController.swift index 60f183cb2..fcadb64a1 100644 --- a/Yep/ViewControllers/About/AboutViewController.swift +++ b/Yep/ViewControllers/About/AboutViewController.swift @@ -43,6 +43,11 @@ final class AboutViewController: SegueViewController { appLogoImageViewTopConstraint.constant = Ruler.iPhoneVertical(0, 20, 40, 60).value appNameLabelTopConstraint.constant = Ruler.iPhoneVertical(10, 20, 20, 20).value + let motionEffect = UIMotionEffect.yep_twoAxesShift(Ruler.iPhoneHorizontal(20, 30, 40).value) + appLogoImageView.addMotionEffect(motionEffect) + appNameLabel.addMotionEffect(motionEffect) + appVersionLabel.addMotionEffect(motionEffect) + appNameLabel.textColor = UIColor.yepTintColor() if let