My Swift 4 UITabBarController
usually has four UITabBarItem
items on it.
In certain circumstances it can have five instead of four, but I always want the far right button to be the same. That means I need to dynamically insert and/or remove the UITabBarItem
in the fourth "slot".
I'm able to handle adding and removing the UITabBarItem
in code with no problem, but I haven't been able to determine how to do it other than by using .append
, which only will add it to the fifth "slot".
Hours of poring over the Apple documentation and Stack Overflow have yielded no solution. How can I insert a UITabBarItem
at a specific index?