Swift 懒加载置 nil 错误: 'nil' 不能赋值给 'UIView' 类型
The error message you are seeing indicates that you are trying to assign the value 'nil' to a UIView type, which is not allowed. In Swift, you cannot assign a 'nil' value to a non-optional type directly. \n\nTo solve this issue, you can make the UIView optional by using the '?' symbol after the type declaration. Here's an example: \n\nswift\nvar myView: UIView? = nil\n\n\nNow, you can assign 'nil' to the optional UIView type without any issues.
原文地址: https://www.cveoy.top/t/topic/pqCy 著作权归作者所有。请勿转载和采集!