Programming in Swift: Functions & Types

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

Part 1: Functions

03. Challenge: Functions

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: 02. Review Functions Next episode: 04. Overloading

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: 03. Challenge: Functions

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’re accessing parts of this content for free, with some sections shown as obfuscated text.

Heads up... You’re accessing parts of this content for free, with some sections shown as obfuscated text.

Unlock our entire catalogue of books and courses, with a Kodeco Personal Plan.

Unlock now

How about a quick challenge to test everything we reviewed in the last episode? You’ll find one in the next page of the Playground for this part of the course. Pause the video, give it a try, and then come back to see what I did with it. Good luck!

func generateTwitterHandle(
(name: String, anotherWord word: String
String = "Meow"
 -> String {
 
 }
name.lowercased() + word
generateTwitterHandle("Ozma")
func deutschify(
func deutschify(_ word1: String, _ word2: String = "katzen")
func deutschify(_ word1: String, _ word2: String = "katzen") -> String {

}
...
  let adjective = ["Frölich", "Rund", "Salzig", "Schwarze"].randomElement()!
  let ending = ["schule", "keit", "maler", "maschine"].randomElement()!
}
...  
  return adjective + word1 + word2 + ending
}
deutschify("swifty")
deutschify("arctic", "tree")