iOS 17 UIKit TabBar Item Animation

212 views Asked by At

I have an App with a 5 item TabBar built with InterfaceBuilder. Each item has an SF Symbol as well as a text title. In iOS 17 with SwiftUI one can apply an SFSymbol animation to an item tap event. Can someone please tell me how I can apply a symbol effect to tabbar items in UIKit?

The following doesn't work:

if #available(iOS 17, *) {
  let house = UIImage(systemName: "house")
  house.addSymbolEffect(.pulse, options: .default, animated: true)
  self.tabBarController?.tabBar.items?[0].image=house
}

because as a required UIImage, there is no context for addSymbolEffect!

0

There are 0 answers