Comments (7)
I also tried changing in
class SOTabBar: UIView
internal var viewControllers = [UIViewController]() {
didSet {
drawTabs()
guard !viewControllers.isEmpty else { return }
drawConstraint()
layoutIfNeeded()
didSelectTab(index: 2)
}
}
from sotabbar.
My solution is, copy the 4 swift files form Pod in your Project and delete the pod. After that you can modify the didSelectTab(index: 1)
in public class SOTabBar: UIView
.
from sotabbar.
It would be great if there is a function to change the selectedTab from any of the child class.
from sotabbar.
Hi @kaigothe, did you find the solution if so, you can push it to the repo and we are happy to have you with us as a contributor .
from sotabbar.
Any solution for this??
from sotabbar.
My solution is, copy the 4 swift files form Pod in your Project and delete the pod. After that you can modify the
didSelectTab(index: 1)
inpublic class SOTabBar: UIView
.
@kaigothe Thanks, it's working...
from sotabbar.
Hi @kaigothe, did you find the solution if so, you can push it to the repo and we are happy to have you with us as a contributor .
I have solution for above issue, follow the steps.
Line No : 137 , Class SOTabBar
func didSelectTab(index: Int) {
if index + 1 == selectedIndex {return}
animateTitle(index: index)
previousSelectedIndex = selectedIndex
selectedIndex = index + 1
delegate?.tabBar(self, didSelectTabAt: index)
animateCircle(with: circlePath)
animateImage()
guard let image = self.viewControllers[index].tabBarItem.selectedImage else {
fatalError("You should insert selected image to all View Controllers")
}
self.tabSelectedImageView.image = image
}
Step 2: class SOTabBarController, set below function at line no : 77
func preSelectedIndex(index: Int){
self.tabBar.didSelectTab(index: index)
}
Step 3: Call the function from your Tabbar class
class UTabbarVC: SOTabBarController {
override func viewDidLoad() {
super.viewDidLoad()
self.delegate = self
// your VC setup here
...
// set here you want to selected index
preSelectedIndex(index: 1)
}
}
from sotabbar.
Related Issues (19)
- On orientation circle not coming on right place HOT 1
- Getting error in SOTabBarItem class
- How to navigate tabbar view to uiviewcontroller class?
- How can we hide the navigation bar when navigation to other view controller? HOT 1
- Errors in readme
- Feature request - allow to set tint color for tab bar image
- Can't change elements after creation HOT 1
- set ColorTitile SOTabBar
- Hide Bottom bar after push HOT 1
- How to hide tabBar other screens HOT 5
- RTL Does not support
- How to hide other view controller if we doesnt choose it?
- How to set the isUserInteractionEnabled
- HOW TO NAVIGATE THE ANOTHER TABBAR ON BUTTON CLICK HOT 2
- Selected Tab Title is not displaying on first launch or when launched app from killed state
- Can't display the navigation controller title for view controller
- Can't find SOTabBarView in scope???
- Not able to add badge with navigation tab bar (tabBarController?.tabBar.addSubview(imagev)).
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sotabbar.