evgenyneu / Cosmos

A star rating control for iOS/tvOS written in Swift
MIT License
2.18k stars 366 forks source link

Storyboard warning on Xcode 12.1: "Ignoring user defined runtime attribute for key path "updateOnTouch"" #176

Open AndrewBennet opened 3 years ago

AndrewBennet commented 3 years ago

Please consider submitting the following information (if relevant):

Hi there, I just updated my project to Xcode 12.1, and I've started to get a build warning from a usage of Cosmos which was previously fine:

BookDetails.storyboard: warning: IB Designables: Ignoring user defined runtime attribute for key path "updateOnTouch" on instance of "UIView". Hit an exception when attempting to set its value: [<UIView 0x7fb0cd5d31f0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key updateOnTouch.

image

image

It reports that a build failed within the IBDesignable view in a storyboard, but when I actually build and run the app it works fine.

evgenyneu commented 3 years ago

Thanks for reporting the issue. I can see a similar one when I open the storyboard for the demo app in Xcode 12 in this project. It showed Cosmos view and had no errors at some point, but then it started showing these red exclamation marks for me with errors. I have no idea how to fix it sorry. I followed this solution, but it did not work for me.

stodyboard_designable_bug
AndrewBennet commented 3 years ago

Weird! Maybe a bug in Xcode 12? If I find a solution I'll let you know.

evgenyneu commented 3 years ago

Thanks.

Maybe a bug in Xcode 12?

Yes, I would not be surprised. CosmosView class uses IBInspectable, IBDesignable attributes to allow changing star colors and sizes from the storyboard. This has never worked 100% reliably in the past.

The start show up for me when I create a new project in Xcode 12 though, but don't work in existing app created in older Xcode.