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
> 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
> 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:
>>
>>
> 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
> 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
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,
> 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:
>>
>>
> 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
>
> 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
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) {
10 matches
Mail list logo