Parameter methods are versatile, meaning you can use them with multiple input values. This movie shows how to create and run parameter methods.
- [Instructor] So far what we've seen in code…simply takes one line of code to run two lines of code.…That already creates quite a bit of optimization,…but methods can actually be even more versatile.…Imagine in this game that we're creating hypothetically…that there are different kinds of monsters…and when you shoot one monster you get one point…and when you shoot another monster you get five points.…Using something called parameters,…methods can actually be versatile…and you can use the same method to add…either one or five points to the score.…
So let's see how that works.…In our definition of our method on line 15…I'm going to put my cursor in the curly braces…and I'm going to declare a parameter called points.…This is going to be of the type integer.…So colon, int, there are some errors…that are popping up right here,…but for now I just want you to ignore them.…On line 16 what I'm going to do is replace that one…with the parameter points.…Now when we run this method we're going to send…an integer in to did score.…
- Installing Xcode
- Creating an Xcode project
- Configuring the iOS Simulator
- Understanding variables
- Connecting visual objects to variables
- Understanding methods
- Connecting a button to a method
- Using conditional statements
- Setting up the user interface (UI)
- Building a complete iOS app
Skill Level Beginner
1. Set Up Your Coding Environment
Create an Xcode project4m 19s
2. Programming Building Blocks: Variables
3. Programming Building Blocks: Methods
4. Programming Building Blocks: Conditional Statements
5. Plan and Prepare the App
6. Build a Full Application
Next steps3m 11s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.