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 Functions and Optionals Optionals Review: Functions

boris said
boris said
3,607 Points

I don't know what to do

Am I meant to make to separate functions or am I meant to make one? I did what it asked and it still says it's not meeting the requirements.

divisible.swift
func isDivisible(#dividend: Int, #divisor: Int) -> Bool {
    if dividend % divisor == 0 {
        return true
    } else {
        return false
    }
}



func isNotDivisble(#dividend: Int, #divisor:Int) -> Bool {
    var status = false
    if dividend % divisor == 0 {
        status = false
        println("Is not divisble")
    } else {
        status = true
        println("Is Divisble")
    }






return status


}


isNotDivisble(dividend: 10, divisor: 2)
Gabe Nadel
seal-mask
.a{fill-rule:evenodd;}techdegree
Gabe Nadel
Treehouse Guest Teacher

Hey Boris,

In the future, if you can write a title that is more descriptive than "I don't know what to do" that would help future students discover your valuable question when they stumble and search for a similar solution.

Cheers and thanks for being apart of The Community!

1 Answer

Raul Tammesalu
Raul Tammesalu
2,348 Points

Seems you might have a typo in function name: it should be isNotDivisible ( 4 x i ). Otherwise function looks correct.