今天,我升级到Xcode10。今天早些时候使用Xcode 9.x编译的同一项目现在抱怨几乎所有的Xcode 10.1中的初始化程序。
我尝试清理项目并重建,没有运气。 我玩过编译器优化级别,没有运气。
在新的Xcode 10项目中编译相同的代码就可以了。编译器错误的其他实例:
let b = UIButton() // throws "Cannot invoke initializer for type 'UIButton' with no arguments"
//1. Overloads for 'UIButton' exist with these partially matching parameter lists: (type: UIButtonType), (frame: CGRect), (coder: NSCoder), (with: UIColor), (with: ThemeColorPicker)
let l = UILabel() // throws "Cannot invoke initializer for type 'UILabel' with no arguments"
var safeAreaLayoutGuideBottom = UIView()// throws "Cannot invoke initializer for type 'UIView' with no arguments"