0

How to get font default of UITabBarItem. Please help if you can get it. Because I want to repeat with the default value. Font Size UITabBarItem changed that I do not know why.

UITabBarItem.appearance().setTitleTextAttributes([NSFontAttributeName: fontDault!], for: .normal)

1 Answers1

0

The simplest solution would be to get the current title text attributes before you set your own attributes. Save that dictionary for use when you wish to reset to those original attributes.

let defaultAttributes = UITabBarItem.appearance().titleTextAttributes(for: .normal)

Then set your own attributes when needed.

When you wish to reset the attributes, do:

UITabBarItem.appearance().setTitleTextAttributes(defaultAttributes, for: .normal)
rmaddy
  • 314,917
  • 42
  • 532
  • 579