这与这个问题相关。该问题并没有帮助我解决我的问题,我检查了此
。
有什么想法吗?
〜/ Library / Logs / DiagnosticReports
并得到 IBDesignablesAgentCocoaTouch_ *. crash
文件,在检查它时显示了这个![Storyboard Error](https://istack.dev59.com/r7jyp.webp)
我尝试删除派生数据,重新启动Xcode,但没有解决。
我使用的操作系统是macOS High Sierra。
我注意到现在每当我从storyboard切换到另一个文件或更改storyboard中的设备时,Xcode都会变为(无响应),然后我就必须强制退出并重新启动Xcode。
编辑:我使用此代码进行状态栏外观。
UIApplication.shared().statusBarStyle = .lightContent
UIApplication.shared() .isStatusBarHidden = false
针对@IBDesignable
extension UIView {
class func loadNib<T: UIView>(_ viewType: T.Type) -> T {
let className = String.className(viewType)
return Bundle(for: viewType).loadNibNamed(className, owner: nil, options: nil).first as! T
}
class func loadNib() -> Self {
return loadNib(self)
}
}
@IBDesignable extension UIView {
@IBInspectable var borderColor:UIColor? {
set {
layer.borderColor = newValue!.cgColor
}
get {
if let color = layer.borderColor {
return UIColor(cgColor:color)
}
else {
return nil
}
}
}
@IBInspectable var borderWidth:CGFloat {
set {
layer.borderWidth = newValue
}
get {
return layer.borderWidth
}
}
@IBInspectable var cornerRadius:CGFloat {
set {
layer.cornerRadius = newValue
clipsToBounds = newValue > 0
}
get {
return layer.cornerRadius
}
}
}
有什么想法吗?
@ibdesignable
或者某种状态栏外观更改?堆栈提示可能存在相关问题。 - Warren Burton