【发布时间】:2023-03-31 07:54:01
【问题描述】:
我在 Swift 3 之前有这个工作(frame 是 CGRect):
extraLightBlurView.frame.makeIntegralInPlace()
但它在 Swift 3 中返回错误 Value of type 'CGRect' has no member 'makeIntegralInPlace'。如何解决这个问题?
【问题讨论】:
我在 Swift 3 之前有这个工作(frame 是 CGRect):
extraLightBlurView.frame.makeIntegralInPlace()
但它在 Swift 3 中返回错误 Value of type 'CGRect' has no member 'makeIntegralInPlace'。如何解决这个问题?
【问题讨论】:
它在 Swift 3 中不可用。请改用 integral 属性:
extraLightBlurView.frame = extraLightBlurView.frame.integral
【讨论】:
extraLightBlurView.frame.integral 返回一个 CGRect。但是我之前的方法makeIntegralInPlace 正在执行一些任务。我想用这个新的返回值做什么?我是否需要在 Swift 3 中调用 makeIntegralInPlace 或者有其他方式来执行 makeIntegralInPlace 曾经做的事情。