• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Xcode 8: Outlet name changed by IB?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Xcode 8: Outlet name changed by IB? (From: David Hoerl <email@hidden>)

  • Prev by Date: Xcode 8: Outlet name changed by IB?
  • Next by Date: Intermittently (most of the time) cannot run my tests in XCode 8y
  • Previous by thread: Xcode 8: Outlet name changed by IB?
  • Next by thread: Intermittently (most of the time) cannot run my tests in XCode 8y
  • Index(es):
    • Date
    • Thread