Reputation: 794
I am trying to animate a change in dimension for a UITableView. The following code worked in beta 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()
})
In beta 5, I get the error "Missing argument for parameter 'delay' in call"
If I change the function to specify the delay:
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()
});
I get the error "Extra argument 'delay' in call"
Not sure if I'm doing something wrong or this is a bug. Any ideas?
Even if I used the most basic syntax:
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)
})
I get the "Missing argument for parameter 'delay' in call" error
Upvotes: 4
Views: 1202
Reputation: 794
Seems like the error was actually to do with calcTopOffsetToCell() not returning a CGFloat and the IDE error was incorrect.
Upvotes: 2