Re: Swift: what is the difference between properties and functions?
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