5. Objects, Data, and Methods _Your First iOS and SwiftUI App


  1. https://www.raywenderlich.com/ios
  2. https://swift.org/documentation/#the-swift-programming-language

Lesson:  5. Objects, Data, and Methods


  1. Functions:  are self-contained chunks of code that perform a specific task. You give a function a name that identifies what it does, and this name is used to “call” the function to perform its task when needed.
  2.  Method: The things that provide functionalities to an object is commonly called a method. A method is simply a function that belongs to an object.

Screen Shot 2020-01-25 at 2.44.20 AM

Screen Shot 2020-01-25 at 2.40.01 AM
The syntax to call a method is to take the object, then put a period, then put by the name of the method. Afterwards, you put parenthesis, and then any parameters to the method, which you can think of as input to the method. The methods you’ve used so far, like fontWeight or foreground color, have been written for you by the engineers at Apple.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: