gpt4 book ai didi

ios - 没有更多上下文的动画选项不明确

转载 作者:行者123 更新时间:2023-11-28 06:48:35 25 4
gpt4 key购买 nike

我创建了一个隐藏函数,它隐藏了一个特定的 View 。但是我不断收到以下错误:“没有更多上下文,表达式类型不明确”。我需要提供什么样的更多上下文?

func hide(toFrame:CGRect, delay:NSTimeInterval) {

UIView.animateWithDuration(animationSettings.duration,
delay: delay,
usingSpringWithDamping: animationSettings.damping,
initialSpringVelocity: animationSettings.velocity,
options: (.BeginFromCurrentState | .AllowUserInteraction),
animations:{
self.frame = self.offScreenFrame
}, completion: {
(value: Bool) in
self.delegate!.didNotifyFinishedAnimation(true)
self.canNotify = true
}
)
}

最佳答案

UIViewAnimationOptionsOptionSetType 可以设置语法来定义选项。因此,需要将上述代码的选项从 (.BeginFromCurrentState | .AllowUserInteraction) 更改为 [.BeginFromCurrentState, .AllowUserInteraction]

UIView.animateWithDuration(animationSettings.duration,
delay: delay,
usingSpringWithDamping: animationSettings.damping,
initialSpringVelocity: animationSettings.velocity,
options: [.BeginFromCurrentState, .AllowUserInteraction],
animations:{
self.frame = self.offScreenFrame
}, completion: {
(value: Bool) in
self.delegate!.didNotifyFinishedAnimation(true)
self.canNotify = true
}
)

关于ios - 没有更多上下文的动画选项不明确,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35553735/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com