Right - the current Swift 4 conversion tool (starting with Xcode 9 Beta 4) is a little carried away.
I was able to quickly fix the problem by returning the UIAppearance conversion UIAppearance , and then updating the individual attributes.
For example, in Swift 3, I had:
UITabBarItem.appearance().setTitleTextAttributes([NSForegroundColorAttributeName: UIColor.white], for: .selected)
Xcode "helped" me by changing it to:
UIAppearance.appearance().setTitleTextAttributes([NSAttributedStringKey.foregroundColor: UIColor.white], for: .selected)
I was able to extinguish the errors in half time so that:
UITabBarItem.appearance().setTitleTextAttributes([NSAttributedStringKey.foregroundColor: UIColor.white], for: .selected)
Justin whitney
source share