Closed zenangst closed 7 years ago
Or you could add a property on the item that you add to tabby to indicate what type of item it is.
enum TabBarItemType {
case .Internal, .External
}
The TabBarItemType
approach sounds nifty, but the delegate
approach seems to be more flexible I think
All right, so I added a Behavior
that will reside in every TabBarItem
. Such behavior has two possibilities: systematic
that is the one that Tabby offers, or custom
, which is your one. It defaults to systematic
, if you set to custom
, nothing will happen.
🚀 🚀 🚀 🚀
I think it could be useful to be able to intercept a navigation before it happens. Play with the idea that you have an item in your tab bar that actually leaves the application, then you don't want that to switch out the controller and to show and empty one when you get back into your application.
We can use Facebook and Facebook Messenger as an example, if you tap that item, you don't navigate inside Facebook, you are transported to Messenger. When you come back to Facebook, it is exactly like you left it.
I don't think this would be to hard to achieve if we change the delegate method on
TabbyController
to return a boolean value. If it is set totrue
, it would change, iffalse
, then it is up to the developer to decide what is suppose to happen when a user taps the item.So instead of this; https://github.com/hyperoslo/Tabby/blob/master/Sources/TabbyController.swift#L8
You would have something like this;