Programming in Swift: Functions & Types

Jan 4 2022 · Swift 5.5, iOS 15, Xcode 13

Part 1: Functions

05. Advanced Parameters

Episode complete

Play next episode

Next
About this episode

Leave a rating/review

See forum comments
Cinema mode Mark complete Download course materials
Previous episode: 04. Overloading Next episode: 06. Challenge: Overloads & Parameters

Get immediate access to this and 4,000+ other videos and books.

Take your career further with a Kodeco Personal Plan. With unlimited access to over 40+ books and 4,000+ professional videos in a single subscription, it's simply the best investment you can make in your development career.

Learn more Already a subscriber? Sign in.

Notes: 05. Advanced 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.

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()
getHighestGrade(for: jessyGrade, ozmaGrade)
getHighestGrade(for: ozmaAllGrades)
//getHighestGrade(for: ozmaAllGrades)
func incrementAndPrint(_ value: Int) {

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