Closed kostiakoval closed 9 years ago
It's like this because standard performSegue is like this and it's good to keep interface compatibility where possible.
I agree with consistency issue.
When you declare an optional variable, the nil
is assigned by default. I have thought it would be useful to do the same for function.
Maybe Apple will change the API later to do the same.
How about this.
The issue I see is that now Xcode don't show the suggestions that there are 2 function (when you use default nil value). So it's a bit unclear when the nil is send implicitly
But if we have 2 functions Xcode will show you them and you can choose which to use.
@kostiakoval I do like the change, however let's wait with this change for iOS9. If Apple update Swift to make it nil, I'd be happy to apply this change. Let's have it drop-in replacement as much as possible.
And I hope Swift guys are working on it already rdar://21437642
ok. Can't find that radar :(
nobody can, unless you an Apple employee ;)
because
sender
is optional, I think it's nice to be able to skip it when you callperformSegue(MainViewController.Segue.ScreenOneSegue)