What are methods?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

What are methods?

Kenny Batista
When reading tutorials about swift at rays wenderlichs I keep reading the word "Methods" on the swift tutorials. What are methods?

--
You received this message because you are subscribed to the Google Groups "Swift Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/swift-language/630f178d-0e95-48f3-81fb-a022192a819c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: What are methods?

Jens Alfke

On Mar 12, 2015, at 8:05 PM, Kenny Batista <[hidden email]> wrote:

When reading tutorials about swift at rays wenderlichs I keep reading the word "Methods" on the swift tutorials. What are methods?

method is a function that belongs to a class. You call a method via an instance of the class, and the method can access that object’s data; the object is a special parameter to the method called “self” or “this” (depending on the language.)

This is a pretty core concept in object-oriented programming; it might be a good idea to look up some OOP tutorials, or find a book. (Have you read Apple’s Swift book? I think it covers this.)

—Jens

--
You received this message because you are subscribed to the Google Groups "Swift Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/swift-language/02C4B53B-91D5-4455-BE27-ED3F438F5C7F%40mooseyard.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: What are methods?

Kenny Batista
Thank You!
On Mar 12, 2015, at 11:57 PM, Jens Alfke <[hidden email]> wrote:


On Mar 12, 2015, at 8:05 PM, Kenny Batista <[hidden email]> wrote:

When reading tutorials about swift at rays wenderlichs I keep reading the word "Methods" on the swift tutorials. What are methods?

method is a function that belongs to a class. You call a method via an instance of the class, and the method can access that object’s data; the object is a special parameter to the method called “self” or “this” (depending on the language.)

This is a pretty core concept in object-oriented programming; it might be a good idea to look up some OOP tutorials, or find a book. (Have you read Apple’s Swift book? I think it covers this.)

—Jens

--
You received this message because you are subscribed to the Google Groups "Swift Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/swift-language/3749F552-E362-432B-A3BA-AB145AAF9030%40gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: What are methods?

Swift Language mailing list
This is a very basic question, and indicated you might be better advised to start with Objective-C first (which also utilize methods)
as the state of documentation of Swift isn't yet at the stage where it's offering introductory tutorials in basic Object-Oriented Programming.


From: Kenny Batista <[hidden email]>
To: Jens Alfke <[hidden email]>
Cc: [hidden email]
Sent: Saturday, 14 March 2015, 10:43
Subject: Re: What are methods?

[..]

method is a function that belongs to a class. You call a method via an instance of the class, and the method can access that object’s data; the object is a special parameter to the method called “self” or “this” (depending on the language.)

This is a pretty core concept in object-oriented programming; it might be a good idea to look up some OOP tutorials, or find a book. (Have you read Apple’s Swift book? I think it covers this.)

—Jens

--
You received this message because you are subscribed to the Google Groups "Swift Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/swift-language/722011094.100712.1426316730623.JavaMail.yahoo%40mail.yahoo.com.
For more options, visit https://groups.google.com/d/optout.