I am using Swift 3, Xcode 8.2.
I want to something like this (ignore the Oscars-themed fill) where the camera button is a bit more prominent/encircled on the tab bar:
I assume the whole thing is an image but is that image just naturally raised off the tab bar in some way?
Any resources or if you can point me in the right direction would be great. Thank you!
EDIT
I may have found another article that explains what I want to do: How do we create a bigger center UITabBar Item
Implement a view controller that can hold some other view controllers. Show one of those view controllers. Show a tab bar at the bottom of the screen over the shown view controller. Switch between the various view controllers when the user taps on a tab bar button.
swift in your assistant editor. You can do this by holding Option on your keyboard and clicking the ViewController. swift file in your Project Navigator. Now click on the button, hold CTRL and then drag it to your Swift file.
Answer: Use self. tabBarController?. tabBar.
One way is to simply add your UIButton on top of UITabBarController with the dummy center view controller.
Here I use storyboard and subclass UITabBarController to add that button:
This is my storyboard, note how the center view controller is just there for space:
With only those code and storyboard, this is the result:
Project here: https://github.com/aunnnn/TestButtonOnTabBar/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With