Re: [swift-evolution] extend trailing closure rule

2016-06-09 Thread Saagar Jha via swift-evolution
How about using a colon to separate it, to make `completion` look like an argument and to separate it from being a function? Something like this: UIView.animate(withDuration: 0.4) { // animations } completion: { finished in // completion } On Thu, Jun 9, 2016 at 1:06 AM Brent Royal-Gordon via sw

Re: [swift-evolution] extend trailing closure rule

2016-06-09 Thread Brent Royal-Gordon via swift-evolution
> Here's a common thing to say: > >UIView.animate(withDuration:0.4, animations: { >self.v.backgroundColor = UIColor.red() >}) > > That's ugly. I'd rather write: > >UIView.animate(withDuration:0.4) { >self.v.backgroundColor = UIColor.red() >} > > What stops me is

Re: [swift-evolution] extend trailing closure rule

2016-06-08 Thread L. Mihalkovic via swift-evolution
> On Jun 8, 2016, at 10:46 PM, Jordan Rose via swift-evolution > wrote: > > >> On Jun 8, 2016, at 12:06, Matt Neuburg via swift-evolution >> wrote: >> >> Stop me if you've heard this one; I've only just joined the list, in order >> to raise it. >> >> Here's a common thing to say: >> >>

Re: [swift-evolution] extend trailing closure rule

2016-06-08 Thread Thorsten Seitz via swift-evolution
> Am 08.06.2016 um 22:59 schrieb Paul Cantrell via swift-evolution > : > > >>> On Jun 8, 2016, at 3:46 PM, Jordan Rose via swift-evolution >>> wrote: >>> >>> >>> On Jun 8, 2016, at 12:06, Matt Neuburg via swift-evolution >>> wrote: >>> >>> Stop me if you've heard this one; I've only jus

Re: [swift-evolution] extend trailing closure rule

2016-06-08 Thread Erica Sadun via swift-evolution
> On Jun 8, 2016, at 4:11 PM, Matt Neuburg via swift-evolution > wrote: > > Well, I guess I didn't pick a strong enough case. Try this one: > >UIView.animate(withDuration:0.4, delay: 0, options: [.autoreverse]) { >self.view.backgroundColor = UIColor.red() >} > > Th

Re: [swift-evolution] extend trailing closure rule

2016-06-08 Thread Matt Neuburg via swift-evolution
Well, I guess I didn't pick a strong enough case. Try this one: UIView.animate(withDuration:0.4, delay: 0, options: [.autoreverse]) { self.view.backgroundColor = UIColor.red() } That doesn't compile. I'm suggesting that it would be cool if it did. m. > On Jun 8, 2016,

Re: [swift-evolution] extend trailing closure rule

2016-06-08 Thread Paul Cantrell via swift-evolution
> On Jun 8, 2016, at 3:46 PM, Jordan Rose via swift-evolution > wrote: > >> >> On Jun 8, 2016, at 12:06, Matt Neuburg via swift-evolution >> wrote: >> >> Stop me if you've heard this one; I've only just joined the list, in order >> to raise it. >> >> Here's a common thing to say: >> >>

Re: [swift-evolution] extend trailing closure rule

2016-06-08 Thread Jordan Rose via swift-evolution
> On Jun 8, 2016, at 12:06, Matt Neuburg via swift-evolution > wrote: > > Stop me if you've heard this one; I've only just joined the list, in order to > raise it. > > Here's a common thing to say: > >UIView.animate(withDuration:0.4, animations: { >self.v.backgroundColor = UIColo

Re: [swift-evolution] extend trailing closure rule

2016-06-08 Thread Rimantas Liubertas via swift-evolution
> > That's ugly. I'd rather write: > > UIView.animate(withDuration:0.4) { > self.v.backgroundColor = UIColor.red() > } > > What stops me is that `animations:` is not eligible for trailing closure > syntax, because it isn't the last parameter — `completion:` is. Actually you can. UIView ha

[swift-evolution] extend trailing closure rule

2016-06-08 Thread Matt Neuburg via swift-evolution
Stop me if you've heard this one; I've only just joined the list, in order to raise it. Here's a common thing to say: UIView.animate(withDuration:0.4, animations: { self.v.backgroundColor = UIColor.red() }) That's ugly. I'd rather write: UIView.animate(withDuration:0.4) {