XIV 6 Beta 5中的UIView.animateWithDuration更改

时间:2014-08-06 00:38:35

标签: ios swift xcode uiview uiviewanimation

我正在尝试为UITableView设置维度的更改动画。以下代码适用于测试版4:

     UIView.animateWithDuration(0.1, animations: {
                tableView.frame = CGRectMake(tableView.frame.origin.x, 0 - self.calcTopOffsetToCell(indexPath), tableView.frame.size.width, tableView.frame.size.height + 190)
            }, completion: { (finished: Bool) in
                self.selectedIndex = indexPath
                cell.amountTextfield.becomeFirstResponder()
            })

在测试版5中,我收到错误“调用中缺少参数'延迟'的参数”

如果我更改功能以指定延迟:

UIView.animateWithDuration(0.5, delay: Double(0), options: .CurveLinear, animations: {
            tableView.frame = CGRectMake(tableView.frame.origin.x, 0 - self.calcTopOffsetToCell(indexPath), tableView.frame.size.width, tableView.frame.size.height + 190)
            }, completion: {
                (finished: Bool) in
                self.selectedIndex = indexPath
                cell.amountTextfield.becomeFirstResponder()
        });

我在调用中得到错误“额外参数'延迟'

不确定我做错了什么或这是一个错误。有什么想法吗?

即使我使用了最基本的语法:

UIView.animateWithDuration(0.5, animations: {
            tableView.frame = CGRectMake(tableView.frame.origin.x, 0 - self.calcTopOffsetToCell(indexPath), tableView.frame.size.width, tableView.frame.size.height + 190)

        })

我在调用中得到“参数'延迟'的缺失参数”错误

1 个答案:

答案 0 :(得分:2)

似乎错误实际上与calcTopOffsetToCell()没有返回CGFloat并且IDE错误不正确。