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

Please help me!

I was doing some reading and I wanted to ask a question. Is this called type casting? var x : Float = 12.0213 Double(x)

1 Answer

Type casting will be something like this

var someVariable = array[0] as! Int

this is called downcasting

Would you show me where you read that please ? I don’t want to give you the wrong information.

What you are doing there is converting a Float type to a Double type, so perhaps it might be called Type casting, but I do not want to give you the wrong information. I looked up Type Casting and it does not show what you are doing there.