Closed swift-ci closed 7 years ago
UIAppearance is a protocol. You're supposed to call its methods on types that implement that protocol.
Comment by Ronald Hernandez (JIRA)
@belkadan duh. Thanks man.
I'm not sure I'd consider this resolved or an invalid bug report.
The Swift Migrator replaces `UITabBar.appearance()` (and the like) with `UIAppearance.appearance()` during migration to Swift 4, which then leads to this compiler error.
Reproduce via:
1. Create iOS project
Additional Detail from JIRA
| | | |------------------|-----------------| |Votes | 0 | |Component/s | | |Labels | Bug | |Assignee | None | |Priority | Medium | md5: 034dbd3b25f23bf4ec1d3caf11d238b7Issue Description:
While updating to Swift 4. We encountered a problem with UIAppearance.
The compiler provides the following error:
Static member 'appearance' cannot be used on protocol metatype 'UIAppearance.Protocol'
UIAppearance.appearance().setTitleTextAttributes([NSAttributedStringKey.font
.NSAttributedStringKey.font: font], for: .selected)