I am trying to get the center x coordinate of the selected tab bar item. I have managed to get the selected index, however I am struggling to figure out how to get the selected TabBarItem's frame and center x coordinate. Any help is much appreciated.
Thanks.
EDIT
I ended up solving my issue mathematically. See my solution below:
//viewControllers refers to the array of ViewControllers controlled by the Tab Bar
let tabSize = tabBar.frame.size.width / CGFloat((viewControllers?.count)!)
let tabBarStart = tabBar.frame.origin.x
let targetX = tabBarStart + (tabSize * index) + (tabSize / 2)