@IBDesignable error: IB Designables: Failed to update auto layout status: Interface Builder Cocoa Touch Tool crashed

前端 未结 22 2029
终归单人心
终归单人心 2020-12-02 04:45

I have a very simple subclass of UITextView that adds the "Placeholder" functionality that you can find native to the Text Field object. Here is my code for the su

相关标签:
22条回答
  • 2020-12-02 05:04

    Add it to the bottom of your Podfile and run pod install

    # Workaround for Cocoapods issue #7606
    
        post_install do |installer|
            installer.pods_project.build_configurations.each do |config|
                config.build_settings.delete('CODE_SIGNING_ALLOWED')
                config.build_settings.delete('CODE_SIGNING_REQUIRED')
            end
        end
    
    0 讨论(0)
  • 2020-12-02 05:06

    For Xcode 8 - Swift

    Adding optional value as default value on @IBInspectable causing issue for me.

    This won't work:

    @IBInspectable var repeatImage: UIImage = UIImage(named:"myImage")!{
          didSet {
           // configureView
          }
    }
    

    This should work:

    @IBInspectable var repeatImage: UIImage = RepeatImageView.getDefaultImage() {
        didSet {
            // configureView()
        }
    }
    
    class func getDefaultImage() -> UIImage {
        if let defaultImage = UIImage(named: "myImage") {
            return defaultImage
        } else {
            return UIImage()
        }
    }
    
    0 讨论(0)
  • 2020-12-02 05:06

    It's like if you got Code from other Developer and you get this error. Just run

    pod install
    

    This worked for me. Hope It helps.

    0 讨论(0)
  • 2020-12-02 05:07

    I was experiencing the similar Interface Builder issues rendering designables.

    Using the technique suggested in this answer I was able to track down the issue to the use of image literals.

    Rendering crash

    self.backgroundImage.image =  #imageLiteral(resourceName: "rectangleCenter")
    

    No rendering crash

    self.backgroundImage.image =  UIImage(named: "rectangleCenter")
    
    0 讨论(0)
  • 2020-12-02 05:07

    Just let it to build and run on simulator if you have error in somewhere else in project just comment it out and run designable first to update designable and uncomment the other codes. It works for me.

    0 讨论(0)
  • 2020-12-02 05:08

    I was just missing this line of code platform :ios, '7.0' and problem was solved. Just this line in your pod file and update your pod issue will be resolved.

    0 讨论(0)
提交回复
热议问题