diff --git a/AZTabBarControllerExample/AZTabBarControllerExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/AZTabBarControllerExample/AZTabBarControllerExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata index 18da6df..919434a 100644 --- a/AZTabBarControllerExample/AZTabBarControllerExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ b/AZTabBarControllerExample/AZTabBarControllerExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -2,6 +2,6 @@ + location = "self:"> diff --git a/AZTabBarControllerExample/AZTabBarControllerExample.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/AZTabBarControllerExample/AZTabBarControllerExample.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/AZTabBarControllerExample/AZTabBarControllerExample.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/AZTabBarControllerExample/AZTabBarControllerExample.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/AZTabBarControllerExample/AZTabBarControllerExample.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved new file mode 100644 index 0000000..3d7f37a --- /dev/null +++ b/AZTabBarControllerExample/AZTabBarControllerExample.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -0,0 +1,25 @@ +{ + "object": { + "pins": [ + { + "package": "AZTabBarController", + "repositoryURL": "/Users/cm0675/iOS/AZTabBarController", + "state": { + "branch": null, + "revision": "ecd825d67bf48a0ff5518f8484b087025f1cc8d5", + "version": "1.4.3" + } + }, + { + "package": "EasyNotificationBadge", + "repositoryURL": "https://github.com/Minitour/EasyNotificationBadge.git", + "state": { + "branch": null, + "revision": "2774998af193a396b1842c0727fe52c2bd217ae2", + "version": "1.2.5" + } + } + ] + }, + "version": 1 +} diff --git a/AZTabBarControllerExample/AZTabBarControllerExample.xcworkspace/xcshareddata/swiftpm/Package.resolved b/AZTabBarControllerExample/AZTabBarControllerExample.xcworkspace/xcshareddata/swiftpm/Package.resolved new file mode 100644 index 0000000..d9a2f68 --- /dev/null +++ b/AZTabBarControllerExample/AZTabBarControllerExample.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -0,0 +1,16 @@ +{ + "object": { + "pins": [ + { + "package": "EasyNotificationBadge", + "repositoryURL": "https://github.com/Minitour/EasyNotificationBadge.git", + "state": { + "branch": null, + "revision": "2774998af193a396b1842c0727fe52c2bd217ae2", + "version": "1.2.5" + } + } + ] + }, + "version": 1 +} diff --git a/Sources/AZTabBarController/AZTabBarButton.swift b/Sources/AZTabBarController/AZTabBarButton.swift index ecffb8d..bd59a47 100644 --- a/Sources/AZTabBarController/AZTabBarButton.swift +++ b/Sources/AZTabBarController/AZTabBarButton.swift @@ -9,7 +9,7 @@ import EasyNotificationBadge import UIKit -public class AZTabBarButton: UIButton{ +open class AZTabBarButton: UIButton{ var longClickTimer: Timer? @@ -88,7 +88,7 @@ public class AZTabBarButton: UIButton{ } - override public func layoutSubviews() { + override open func layoutSubviews() { if didAddBadge{ super.layoutSubviews() @@ -115,7 +115,7 @@ public class AZTabBarButton: UIButton{ } - override init(frame: CGRect) { + public override init(frame: CGRect) { super.init(frame: frame) centerTitleLabel() } diff --git a/Sources/AZTabBarController/AZTabBarController.swift b/Sources/AZTabBarController/AZTabBarController.swift index 78104fb..cc26142 100644 --- a/Sources/AZTabBarController/AZTabBarController.swift +++ b/Sources/AZTabBarController/AZTabBarController.swift @@ -139,6 +139,8 @@ open class AZTabBarController: UIViewController { /// Is the tab bar in the middle of an animation. fileprivate (set) open var isAnimating: Bool = false + open var tabButtonActionAnimated: Bool? = nil + /// If the separator line view that is between the buttons container and the primary view container is visable. open var separatorLineVisible:Bool = true{ didSet{ @@ -807,7 +809,7 @@ open class AZTabBarController: UIViewController { * MARK: - Actions */ - @objc func tabButtonAction(button:UIButton){ + @objc open func tabButtonAction(button:UIButton){ if let index = self.buttons.firstIndex(of: button){ delegate?.tabBar(self, didSelectTabAtIndex: index) @@ -956,7 +958,7 @@ open class AZTabBarController: UIViewController { } } - private func createButton(forIndex index:Int)-> UIButton{ + open func createButton(forIndex index:Int)-> UIButton{ let button = AZTabBarButton(type: .custom) button.setTitle(" ", for: []) button.delegate = self @@ -1120,6 +1122,9 @@ extension AZTabBarController: AZTabBarButtonDelegate{ } public func shouldAnimate(_ tabBarButton: AZTabBarButton) -> Bool { + if let animated = tabButtonActionAnimated { + return animated + } if tabBarButton.tag == selectedIndex || self.highlightedButtonIndexes.contains(tabBarButton.tag) || isAnimating{ return false }