From 076441db41845c2b58bf6d682cafd79d2c591eea Mon Sep 17 00:00:00 2001 From: Ann Date: Thu, 13 May 2021 16:39:23 +0800 Subject: [PATCH 1/3] =?UTF-8?q?feat:=20=E9=96=8B=E5=87=BA=E6=AC=8A?= =?UTF-8?q?=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../contents.xcworkspacedata | 2 +- .../xcshareddata/IDEWorkspaceChecks.plist | 8 ++++++ .../xcshareddata/swiftpm/Package.resolved | 25 +++++++++++++++++++ .../xcshareddata/swiftpm/Package.resolved | 16 ++++++++++++ .../AZTabBarController/AZTabBarButton.swift | 6 ++--- .../AZTabBarController.swift | 4 +-- 6 files changed, 55 insertions(+), 6 deletions(-) create mode 100644 AZTabBarControllerExample/AZTabBarControllerExample.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist create mode 100644 AZTabBarControllerExample/AZTabBarControllerExample.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved create mode 100644 AZTabBarControllerExample/AZTabBarControllerExample.xcworkspace/xcshareddata/swiftpm/Package.resolved 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..3dfe2ed 100644 --- a/Sources/AZTabBarController/AZTabBarController.swift +++ b/Sources/AZTabBarController/AZTabBarController.swift @@ -807,7 +807,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 +956,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 From 72d1f576a44ade7fb1d75be98eea49bc0a57123c Mon Sep 17 00:00:00 2001 From: Ann Date: Tue, 15 Jun 2021 15:00:24 +0800 Subject: [PATCH 2/3] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0=E9=BB=9E?= =?UTF-8?q?=E6=93=8A=E5=8B=95=E7=95=AB=E7=94=B1=E5=A4=96=E9=83=A8=E6=8E=A7?= =?UTF-8?q?=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Sources/AZTabBarController/AZTabBarController.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Sources/AZTabBarController/AZTabBarController.swift b/Sources/AZTabBarController/AZTabBarController.swift index 3dfe2ed..c623a99 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 = true + /// If the separator line view that is between the buttons container and the primary view container is visable. open var separatorLineVisible:Bool = true{ didSet{ @@ -816,7 +818,7 @@ open class AZTabBarController: UIViewController { } if index != NSNotFound { - self.setIndex(index, animated: true) + self.setIndex(index, animated: tabButtonActionAnimated) } } } From d52614c92ba7d2865e5cf2e1bec81793b8fb4621 Mon Sep 17 00:00:00 2001 From: Ann Date: Tue, 15 Jun 2021 15:39:10 +0800 Subject: [PATCH 3/3] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0=E6=98=AF?= =?UTF-8?q?=E5=90=A6=E9=96=8B=E5=95=9F=E9=BB=9E=E6=93=8A=E5=8B=95=E7=95=AB?= =?UTF-8?q?=E7=94=B1=E5=A4=96=E9=83=A8=E6=8E=A7=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Sources/AZTabBarController/AZTabBarController.swift | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Sources/AZTabBarController/AZTabBarController.swift b/Sources/AZTabBarController/AZTabBarController.swift index c623a99..cc26142 100644 --- a/Sources/AZTabBarController/AZTabBarController.swift +++ b/Sources/AZTabBarController/AZTabBarController.swift @@ -139,7 +139,7 @@ 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 = true + 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{ @@ -818,7 +818,7 @@ open class AZTabBarController: UIViewController { } if index != NSNotFound { - self.setIndex(index, animated: tabButtonActionAnimated) + self.setIndex(index, animated: true) } } } @@ -1122,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 }