@IBDesignable crashing agent

前端 未结 10 916
自闭症患者
自闭症患者 2020-11-29 02:59

When I write my own UIButton-extended class and make it @IBDesignable, I receive two errors in Interface Builder, namely:

  • Main.storyb
10条回答
  •  醉酒成梦
    2020-11-29 03:53

    In Xcode 7.3, none of the above solutions worked for me, but the accepted answer to this question did: Failed to render instance of IB Designables

    1. Clear Xcode derived data for the project. They are in ~/Library/Developer/Xcode/DerivedData
    2. Clean your current build by pressing ⌘⇧K
    3. Build your project
    4. In storyboard go to Editor menu and do Refresh All Views; wait for build to be completed and errors should be gone

    I did not need to do the 4th step to solve the problem (and get my PaintCode-drawRect'd UIView to paint in the storyboard), included here just in case.

    Credit to @Mojtaba and @WeZZard

提交回复
热议问题