Programming in Swift: Functions & Types

Jan 4 2022 Swift 5.5, iOS 15, Xcode 13

Part 1: Functions

5. Advanced Parameters

Lesson Complete

Play Next Lesson
Save for later
About this episode
See versions

See course reviews

See forum comments
Cinema mode Mark as Complete Download course materials
Previous episode: 4. Overloading Next episode: 6. Challenge: Overloads & Parameters

Update Notes: This course was originally recorded in 2019. It has been reviewed and all content and materials updated as of October 2021.

Heads up... You've reached locked video content where the transcript will be shown as obfuscated text.

You can unlock the rest of this video course, and our entire catalogue of books and videos, with a Professional subscription.

Now that you’ve got a handle on overloading functions, there are a couple more fancy things you should know how to do with function parameters.

print(jessyGrade, ozmaGrade, "meow")
func getHighestGrade(for grades: Int...) -> Int {

  grades.max() ?? 0
getHighestGrade(for: jessyGrade, ozmaGrade)
getHighestGrade(for: ozmaAllGrades)
//getHighestGrade(for: ozmaAllGrades)
func incrementAndPrint(_ value: Int) {

  value += 1
func incrementAndPrint(_ value: 😺inout🛑 Int) {...