0
我在嘗試在我的課程中實現@IBDesignable
時出現上述錯誤。我嘗試過所有的在線解決方案,比如刪除派生日期更新窗口等,但沒有任何工作適合我。 我使用cocoapods version 1.2.1
這是我的課怎麼看起來未能呈現實例庫未加載[macOS]
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
}
}
這是我podfile外觀
source 'https://github.com/CocoaPods/Specs.git'
platform :osx, ’10.11’
target 'ProjectName’ do
use_frameworks!
pod 'SwiftDate', '~> 4.1.7’
end