UITraitCollection is not supported on watchOS

Hello,

I'm trying to use UIColor(named: name, in: Bundle(identifier: "foobar"), compatibleWith: nil) but when it is accessed from watch application I'm getting this error:

error: type of expression is ambiguous without more context

Is this constructor supported from watch os?

1 Like

According to the docs, this is available in watchOS 4.0+
https://developer.apple.com/documentation/uikit/uicolor/2877381-init

1 Like
Terms of Service

Privacy Policy

Cookie Policy