【发布时间】:2018-01-08 10:57:30
【问题描述】:
我在课堂上尝试实现@IBDesignable 时遇到上述错误。我已经尝试了所有在线解决方案,例如删除派生日期更新 pod 等。但没有什么对我有用。
我正在使用cocoapods version 1.2.1
这就是我的班级的样子
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
【问题讨论】:
标签: swift xcode macos cocoapods swiftdate