failed to render instance library not loaded [macOS]

186 views Asked by At

I am getting the above error while trying to implement @IBDesignable in my class. I have tried all the online solutions like deleting derived date updating pod etc. But nothing is working for me. I am using cocoapods version 1.2.1 This is how my class looks

import Cocoa

@IBDesignable class ClassName: NSView {

    required init?(coder: NSCoder) {
        super.init(coder: coder)
        commonInit();
    }

    override init(frame frameRect: NSRect) {
        super.init(frame: frameRect)
        commonInit();
    }

    func commonInit(){
        wantsLayer = true;
    }

    override func prepareForInterfaceBuilder() {
        layer?.backgroundColor = NSColor.darkGray.cgColor

    }
}

This is how my podfile looks

source 'https://github.com/CocoaPods/Specs.git'
platform :osx, ’10.11’

target 'ProjectName’ do
  use_frameworks!
  pod 'SwiftDate', '~> 4.1.7’

end

This is the screenshot of the error i am getting enter image description here

1

There are 1 answers

0
sumesh On BEST ANSWER

in my target project i went to Runpath Search Paths and edited @loader_path/Frameworks to @loader_path/../Frameworks. Doing this fixed the issue for me.