Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS Swift 2.0 Functions Function Parameters Function Parameters

Benjamin Lim
Benjamin Lim
2,747 Points

When did we ever learn to add external names to parameters? I'm flipping through my notes and cannot find it?

Am I forgetting something? It's asking me to add an external name to the parameter? Is this something that we've been taught so far or are we expect to figure it out for ourselves?

functions.swift
// Enter your code below
func getRemainder(a: Int, b: Int) -> Int {
return a % b

}

2 Answers

Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,860 Points

Hey Benjamin,

Pasan coves local and external parameter names in the video right before this challenge. He starts right at the beginning and shows how to create an external parameter name at the ~1:30 mark in the video.

Hope this helps. :dizzy:

Angel Caro
Angel Caro
11,831 Points

You add external parameters before the parameter like value for a and divisor for b like so:

func getRemainder(value a: Int, divisor b: Int) -> Int {
      return a % b
      }