From 6f4ed9c0da271eed6d51fbc6461a18915302d0eb Mon Sep 17 00:00:00 2001 From: Khoren Markosyan Date: Wed, 11 Jul 2018 18:14:01 +0400 Subject: [PATCH 1/3] Fixed a crash when tab bar items is 0. --- RAMAnimatedTabBarController/RAMAnimatedTabBarController.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RAMAnimatedTabBarController/RAMAnimatedTabBarController.swift b/RAMAnimatedTabBarController/RAMAnimatedTabBarController.swift index 1d157fd1..d694ceb4 100644 --- a/RAMAnimatedTabBarController/RAMAnimatedTabBarController.swift +++ b/RAMAnimatedTabBarController/RAMAnimatedTabBarController.swift @@ -392,7 +392,7 @@ open class RAMAnimatedTabBarController: UITabBarController { fileprivate func createViewContainers() -> [String: UIView] { - guard let items = tabBar.items else { + guard let items = tabBar.items, items.count > 0 else { return [:] } From 73ccf08668f9d28940c78b95c12b87a7082b4693 Mon Sep 17 00:00:00 2001 From: Khoren Markosyan Date: Wed, 11 Jul 2018 18:17:58 +0400 Subject: [PATCH 2/3] Fixed selected icon color bug for Fum and Rotation animation types. --- .../Animations/FumeAnimation/RAMFumeAnimation.swift | 4 ++-- .../Animations/RotationAnimation/RAMRotationAnimation.swift | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/RAMAnimatedTabBarController/Animations/FumeAnimation/RAMFumeAnimation.swift b/RAMAnimatedTabBarController/Animations/FumeAnimation/RAMFumeAnimation.swift index 020acd2b..74f9d90b 100755 --- a/RAMAnimatedTabBarController/Animations/FumeAnimation/RAMFumeAnimation.swift +++ b/RAMAnimatedTabBarController/Animations/FumeAnimation/RAMFumeAnimation.swift @@ -40,7 +40,7 @@ open class RAMFumeAnimation: RAMItemAnimation { if let iconImage = icon.image { let renderImage = iconImage.withRenderingMode(.alwaysTemplate) icon.image = renderImage - icon.tintColor = textSelectedColor + icon.tintColor = iconSelectedColor } } @@ -82,7 +82,7 @@ open class RAMFumeAnimation: RAMItemAnimation { if let iconImage = icon.image { let renderImage = iconImage.withRenderingMode(.alwaysTemplate) icon.image = renderImage - icon.tintColor = textSelectedColor + icon.tintColor = iconSelectedColor } } diff --git a/RAMAnimatedTabBarController/Animations/RotationAnimation/RAMRotationAnimation.swift b/RAMAnimatedTabBarController/Animations/RotationAnimation/RAMRotationAnimation.swift index 4f6a1718..8221de04 100755 --- a/RAMAnimatedTabBarController/Animations/RotationAnimation/RAMRotationAnimation.swift +++ b/RAMAnimatedTabBarController/Animations/RotationAnimation/RAMRotationAnimation.swift @@ -83,7 +83,7 @@ open class RAMRotationAnimation: RAMItemAnimation { if let iconImage = icon.image { let renderImage = iconImage.withRenderingMode(.alwaysTemplate) icon.image = renderImage - icon.tintColor = textSelectedColor + icon.tintColor = iconSelectedColor } } From e89ed595c5e1aede06b1e004cef5f82ec5a03d79 Mon Sep 17 00:00:00 2001 From: Khoren Markosyan Date: Wed, 11 Jul 2018 18:31:30 +0400 Subject: [PATCH 3/3] Change protection level for Rotation and Transition animation classes. (they were not accessible when using cocoapods) --- .../RotationAnimation/RAMRotationAnimation.swift | 8 ++++---- .../RAMTransitionItemAnimations.swift | 16 ++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/RAMAnimatedTabBarController/Animations/RotationAnimation/RAMRotationAnimation.swift b/RAMAnimatedTabBarController/Animations/RotationAnimation/RAMRotationAnimation.swift index 8221de04..4e9518f0 100755 --- a/RAMAnimatedTabBarController/Animations/RotationAnimation/RAMRotationAnimation.swift +++ b/RAMAnimatedTabBarController/Animations/RotationAnimation/RAMRotationAnimation.swift @@ -111,18 +111,18 @@ open class RAMRotationAnimation: RAMItemAnimation { } /// The RAMLeftRotationAnimation class provides letf rotation animation. -class RAMLeftRotationAnimation: RAMRotationAnimation { +open class RAMLeftRotationAnimation: RAMRotationAnimation { - override init() { + public override init() { super.init() direction = RAMRotationDirection.left } } /// The RAMRightRotationAnimation class provides rigth rotation animation. -class RAMRightRotationAnimation: RAMRotationAnimation { +open class RAMRightRotationAnimation: RAMRotationAnimation { - override init() { + public override init() { super.init() direction = RAMRotationDirection.right } diff --git a/RAMAnimatedTabBarController/Animations/TransitionAniamtions/RAMTransitionItemAnimations.swift b/RAMAnimatedTabBarController/Animations/TransitionAniamtions/RAMTransitionItemAnimations.swift index dd195902..380eb4c9 100755 --- a/RAMAnimatedTabBarController/Animations/TransitionAniamtions/RAMTransitionItemAnimations.swift +++ b/RAMAnimatedTabBarController/Animations/TransitionAniamtions/RAMTransitionItemAnimations.swift @@ -92,36 +92,36 @@ open class RAMTransitionItemAnimations: RAMItemAnimation { } } -class RAMFlipLeftTransitionItemAnimations: RAMTransitionItemAnimations { +open class RAMFlipLeftTransitionItemAnimations: RAMTransitionItemAnimations { - override init() { + public override init() { super.init() transitionOptions = UIViewAnimationOptions.transitionFlipFromLeft } } -class RAMFlipRightTransitionItemAnimations: RAMTransitionItemAnimations { +open class RAMFlipRightTransitionItemAnimations: RAMTransitionItemAnimations { - override init() { + public override init() { super.init() transitionOptions = UIViewAnimationOptions.transitionFlipFromRight } } -class RAMFlipTopTransitionItemAnimations: RAMTransitionItemAnimations { +open class RAMFlipTopTransitionItemAnimations: RAMTransitionItemAnimations { - override init() { + public override init() { super.init() transitionOptions = UIViewAnimationOptions.transitionFlipFromTop } } -class RAMFlipBottomTransitionItemAnimations: RAMTransitionItemAnimations { +open class RAMFlipBottomTransitionItemAnimations: RAMTransitionItemAnimations { - override init() { + public override init() { super.init() transitionOptions = UIViewAnimationOptions.transitionFlipFromBottom