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 Basics Swift Types Recap: Swift Types

Sherwin Riahi
Sherwin Riahi
472 Points

Not sure what to do.

I can't figure out what works for this challenge. Any help?

2 Answers

David Papandrew
David Papandrew
8,386 Points

So for the second part you add this code:

let product = firstValue * secondValue
let output = "The product of \(firstValue) times \(secondValue) is \(product)"
David Papandrew
David Papandrew
8,386 Points

Hi Sherwin,

The challenge is just asking you to declare two constants and assign an integer value to them (in my example I use "12" and "13" but you can use any integer, e.g. whole number, value.

Here's how to do it:

// Enter your code below
let firstValue = 12
let secondValue = 13

Alternatively you can also declare the type explicitly:

// Enter your code below
let firstValue: Int = 12
let secondValue: Int = 13
Sherwin Riahi
Sherwin Riahi
472 Points

I have figured out that part, but I can't figure out the second part.