Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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.