Skip to content

Commit

Permalink
Manual selection fix
Browse files Browse the repository at this point in the history
  • Loading branch information
askopin committed Feb 20, 2019
1 parent dbbad2d commit d3c5e9d
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 14 deletions.
2 changes: 1 addition & 1 deletion BubbleTabBar.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|
s.name = 'BubbleTabBar'
s.swift_version = '4.2'
s.version = '0.8.1'
s.version = '0.8.2'
s.summary = 'One another nice animated tabbar'
s.homepage = 'https://github.com/Cuberto/bubble-icon-tabbar'
# s.screenshots = 'www.example.com/screenshots_1', 'www.example.com/screenshots_2'
Expand Down
12 changes: 0 additions & 12 deletions BubbleTabBar/Classes/BubbleTabBar.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,8 @@ open class BubbleTabBar: UITabBar {
private var buttons: [CBTabBarButton] = []
public var animationDuration: Double = 0.3

fileprivate var shouldSelectOnTabBar = true
open override var selectedItem: UITabBarItem? {
willSet {
guard shouldSelectOnTabBar else {
shouldSelectOnTabBar = true
return

}
guard let newValue = newValue else {
buttons.forEach { $0.setSelected(false) }
return
Expand All @@ -29,9 +23,7 @@ open class BubbleTabBar: UITabBar {
index != NSNotFound else {
return
}

select(itemAt: index, animated: false)

}
}

Expand Down Expand Up @@ -181,10 +173,6 @@ open class BubbleTabBar: UITabBar {
button.setSelected(false, animationDuration: animated ? animationDuration : 0)
}
selectedbutton.setSelected(true, animationDuration: animated ? animationDuration : 0)
if let item = items?[index] {
shouldSelectOnTabBar = false
selectedItem = item
}
if animated {
UIView.animate(withDuration: animationDuration) {
self.container.layoutIfNeeded()
Expand Down
2 changes: 1 addition & 1 deletion BubbleTabBar/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>0.8.1</string>
<string>0.8.2</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
</dict>
Expand Down

0 comments on commit d3c5e9d

Please sign in to comment.