Re: Xcode 8: Outlet name changed by IB?
Re: Xcode 8: Outlet name changed by IB?
- Subject: Re: Xcode 8: Outlet name changed by IB?
- From: Quincey Morris <email@hidden>
- Date: Mon, 19 Sep 2016 11:38:12 -0700
- Feedback-id: 167118m:167118agrif8a:167118saLqGi71Xs:SMTPCORP
On Sep 19, 2016, at 10:49 , David Hoerl <email@hidden> wrote:
>
> @IBAction func EditingDidEnd(sender: UITextField)
The above line of code in Swift 2.2 means:
@IBAction func EditingDidEnd(_ sender: UITextField)
in Swift 3. That same quoted line of code in Swift 3 means:
@IBAction func EditingDidEnd(sender sender: UITextField)
in Swift 2.2.
In other words, IB is apparently treating your current declaration as if it was written in Swift 3 syntax. If nothing else is going on, that would be a bug in Xcode 8 IB, since AFAIK there’s no change in this area of syntax between Swift 2.2 (Xcode 7) and 2.3 (Xcode 8), and your project was only converted to 2.3.
As a workaround, I would use the last version:
@IBAction func EditingDidEnd(sender sender: UITextField)
instead of:
@IBAction func EditingDidEndWithSender(sender: UITextField)
That’s because the “…WithSender” version will break again when you transition to Swift 3. The “sender sender” version will likely produce a compile time warning that the extra “sender” is redundant, but otherwise work as before.
Or, you could try the “_ sender” version now, and live with the compiler warning until you go to Swift 3.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden