• 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: why is this Swift initializer legal
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: why is this Swift initializer legal


  • Subject: Re: why is this Swift initializer legal
  • From: Quincey Morris <email@hidden>
  • Date: Sat, 06 Jun 2015 19:13:36 +0000

On Jun 6, 2015, at 02:43 , Roland King <email@hidden> wrote:
>
> I was looking to see if I could find an exception to the rule which this fell under but can’t.

It looks like this isn’t something that falls under those rules, but is rather one of the Swift compiler conveniences that writes boilerplate code for you: if you don’t write the super.init call, the compiler inserts it for you.

AFAICT from playing around in playgrounds, it only does this for a parameterless super.init, and it only does this when the superclass has no other designated initializers.



_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


References: 
 >why is this Swift initializer legal (From: Roland King <email@hidden>)

  • Prev by Date: Re: why is this Swift initializer legal
  • Next by Date: Forwarding messages to another class
  • Previous by thread: Re: why is this Swift initializer legal
  • Next by thread: Re: why is this Swift initializer legal
  • Index(es):
    • Date
    • Thread