How to fix “'@IBInspectable' attribute is meaningless on a property that cannot be represented in Objective-C” warning

前端 未结 3 1036
醉梦人生
醉梦人生 2021-01-01 16:15

In Xcode 9 and Swift 4 I always get this warning for some IBInspectable properties:

    @IBDesignable public class CircularIndicator: UIView {
          


        
3条回答
  •  离开以前
    2021-01-01 16:28

    Below two points might helps you

    1. As there is no concept of optional in objective c, So optional IBInspectable produces this error. I removed the optional and provided a default value.

    2. If you are using some enumerations types, then write @objc before that enum to remove this error.

提交回复
热议问题