• 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: Swift: what is the difference between properties and functions?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Swift: what is the difference between properties and functions?


  • Subject: Re: Swift: what is the difference between properties and functions?
  • From: Jens Alfke <email@hidden>
  • Date: Fri, 01 Aug 2014 08:24:12 -0700


On Aug 1, 2014, at 1:49 AM, Gerriet M. Denkmann <email@hidden> wrote:

Is one more efficient than the other? Or stylistically better? 

I’m pretty sure the performance is identical.
As for style, you should use a property if it’s something that feels like a property/attribute of the object. Otherwise — especially if it’s something that has side effects — it should be a function.

(Really, this is exactly the same as the answer for Objective-C.)

—Jens
 _______________________________________________
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: 
 >Swift: what is the difference between properties and functions? (From: "Gerriet M. Denkmann" <email@hidden>)

  • Prev by Date: Re: XCode 5 - Logging
  • Next by Date: Re: XCode 5 - Logging
  • Previous by thread: Swift: what is the difference between properties and functions?
  • Next by thread: Re: Swift: what is the difference between properties and functions?
  • Index(es):
    • Date
    • Thread