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 Functions in Swift Adding Power to Functions Function Parameters

Nigel Matheson
PLUS
Nigel Matheson
Courses Plus Student 1,166 Points

not working for me

Not having much luck with this code.

Please help

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

}

4 Answers

Nico Schmidt
Nico Schmidt
12,781 Points

You are almost there. You want to capitalise Int.

Luc Bernardin
Luc Bernardin
3,726 Points

Types in Swift always use upper camel case. Declaring a variable or constant of type string with i.e. let a: string will not work, in this case it would be declared with let a: String

Now apply this to your problem where you declare and return integers.

Nico Schmidt
Nico Schmidt
12,781 Points

Is it not how I said it? In your code example it is lower camel case.Am I missing the point?

Luc Bernardin
Luc Bernardin
3,726 Points

Yes Nico, i simply gave more explanation and more info on what was wrong and how to fix it without giving the answer straight away.

Nico Schmidt
Nico Schmidt
12,781 Points

Sorry, that is fine. I confused you with Nigel.