知道如何从 didSet 中返回 UIView 吗?
我有一个返回 UIView 的方法。我需要观察一个 Int 并随着 Int 的变化返回一个 UIView。我有一个 didSet 观察者集,但是,在尝试返回 UIView 时出现错误。
感谢任何帮助!谢谢。
func newUIView() -> UIView {
var newUIView = UIView()
return newUIView
}
var observingValue: Int = someOtherValue {
didSet {
//Xcode complains whether I use return or not
return func newUIView()
}
}