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

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

You are almost there. You want to capitalise Int.

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.

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

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.

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

Thank you guys