gpt4 book ai didi

ios - UIView transitionWithView 快速语法

转载 作者:IT王子 更新时间:2023-10-29 05:20:21 26 4
gpt4 key购买 nike

有人可以帮助我了解 swift 中 transitionWithView 的语法吗?在 objective-c 中我会这样使用它:

[UIView transitionWithView:[ self view ] duration:0.325 options:UIViewAnimationOptionCurveEaseOut animations:
^{
// do the transition
}
completion:
^( BOOL finished ){
// cleanup after the transition
}];

但是我无法让完成处理程序工作。谢谢

最佳答案

Swift 5.x 中会像这样:

UIView.transition(with: self.view, duration: 0.325, options: .curveEaseInOut, animations: {

// animation

}) { finished in

// completion

}

关于ios - UIView transitionWithView 快速语法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24413539/

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