Skip to main content

πŸš€ In our NEW AI Bootcamp you'll build a working app in 28 days, no experience required. Free to all subscription levels.

Join the Treehouse affiliate program and earn 25% recurring commission! πŸ€‘

✨ Earn college credits in Cybersecurity, JS, HTML, CSS and Python

  • Treehouse Logo
    • For Individuals
    • For Businesses
    • For Schools
    • For Libraries
    • For Military
    • All Courses
    • Tracks
    • AI Bootcamp
    • College Credit
    • Techdegree Bootcamps
    • Front End Development
    • Full Stack JavaScript
    • Code Adventures
    • Discord
    • Forum
    • Success Stories
    • Treehouse Links
    • 100 Days of Code
    • Explore
    • Career Toolbox
    • Free Treehouse Near Me
    • Affiliates
    • Blog
    • Support
    • About
    • Learn
    • Beginner's Guide to Coding
    • Data Analysis with SQL & Python
    • Front-End Web Development
    • Python Programming Basics
    • Techdegree Bootcamp Overview
    • UX Design Fundamentals
    • AI Tools for Beginners
  • For Individuals For Businesses For Schools For Libraries For Military
  • All Courses Tracks AI Bootcamp College Credit
  • Techdegree Bootcamps Front End Web Development Full Stack JavaScript
  • Code Adventures Discord Forum Success Stories Treehouse Links 100 Days of Code
  • Explore Career Toolbox Free Treehouse Near Me Affiliates Blog Support About
    Learn Beginner's Guide to Coding Data Analysis with SQL & Python Front-End Web Development Python Programming Basics Techdegree Bootcamp Overview UX Design Fundamentals AI Tools for Beginners
  • Sign In
  • Free Trial
Instagram Twitter Facebook YouTube LinkedIn
Loading banner... Start your free trial at Treehouse
    • Newest
      • Newest
      • Active
      • Unanswered
      • Featured
    • All Topics
      • All Topics
      • • General Discussion
      • • AI
      • • APIs
      • • Coding for Kids
      • • College Credit
      • • Computer Science
      • • CSS
      • • Data Analysis
      • • Databases
      • • Design
      • • Development Tools
      • • Digital Literacy
      • • Game Development
      • • Go Language
      • • HTML
      • • Java
      • • JavaScript
      • • Learning Resources
      • • Machine Learning
      • • No-Code
      • • PHP
      • • Professional Growth
      • • Python
      • • Quality Assurance
      • • React
      • • Ruby
      • • Security
      • • Swift
      • • Vibe Coding
  • George Hawkins
    George Hawkins
    4,269 Points

    How to convert from String to Int in code 8

    Posted June 20, 2016 10:06pm by George Hawkins
    George Hawkins
    4,269 Points
    • iOS
    • Swift Functions and Optionals
    • Optionals
    • Optional Chaining

    1 Answer

  • Ian Hicks
    Ian Hicks
    3,889 Points

    XCode 7, the toInt() is not available?

    Posted October 6, 2015 4:08am by Ian Hicks
    Ian Hicks
    3,889 Points
    • iOS
    • Swift Functions and Optionals
    • Optionals
    • Optional Chaining

    1 Answer

  • julienclemencon
    julienclemencon
    1,559 Points

    Swift 2: replacing ?.toInt() with ?.int()

    Posted September 24, 2015 9:43am by julienclemencon
    julienclemencon
    1,559 Points
    • iOS
    • Swift Functions and Optionals
    • Optionals
    • Optional Chaining

    3 Answers

  • Linh Nguyen
    PLUS
    Linh Nguyen
    Courses Plus Student 984 Points

    .toInt() is longer available and it's driving me insane

    Posted September 20, 2015 2:05am by Linh Nguyen
    Linh Nguyen
    Courses Plus Student 984 Points
    • iOS
    • Swift Functions and Optionals
    • Optionals
    • Optional Chaining

    1 Answer

  • Stanley Lim
    Stanley Lim
    209 Points

    Why is 2:51 unsafe with the bang unwrapping?

    Posted September 12, 2015 3:33am by Stanley Lim
    Stanley Lim
    209 Points
    • iOS
    • Swift Functions and Optionals
    • Optionals
    • Optional Chaining

    2 Answers

  • isabelbolger
    isabelbolger
    1,412 Points

    Do not see the option of Int? toInt() for optional chaining video

    Posted August 19, 2015 10:57pm by isabelbolger
    isabelbolger
    1,412 Points
    • iOS
    • Swift Functions and Optionals
    • Optionals
    • Optional Chaining

    1 Answer

  • HaeJu Lee
    HaeJu Lee
    3,811 Points

    Question About findApt(β€œ101”)?.toInt() and ? mark for optionals

    Posted July 12, 2015 6:09pm by HaeJu Lee
    HaeJu Lee
    3,811 Points
    • iOS
    • Swift Functions and Optionals
    • Optionals
    • Optional Chaining

    3 Answers

  • William Rodriguez
    William Rodriguez
    1,923 Points

    Why is the "let" necessary in the if-let statement? Wouldn't if just work fine without it? Why make it a constant?

    Posted June 11, 2015 5:11pm by William Rodriguez
    William Rodriguez
    1,923 Points
    • iOS
    • Swift Functions and Optionals
    • Optionals
    • Optional Chaining

    1 Answer

  • Martin Adams
    Martin Adams
    1,513 Points

    There’s an error in your code at #00:48. It should read: println("\(aptNumber) is the culprit")

    Posted May 16, 2015 1:40am by Martin Adams
    Martin Adams
    1,513 Points
    • iOS
    • Swift Functions and Optionals
    • Optionals
    • Optional Chaining

    0 Answers

  • Ryan Norton
    Ryan Norton
    6,218 Points

    Why is the "?" suffix needed at all when chaining optionals?

    Posted May 4, 2015 2:50am by Ryan Norton
    Ryan Norton
    6,218 Points
    • iOS
    • Swift Functions and Optionals
    • Optionals
    • Optional Chaining

    1 Answer

  • Megan Bullington
    Megan Bullington
    6,245 Points

    In all of the videos, an optional returns "Some" and then the value. My xCode is just returning the value.

    Posted April 22, 2015 4:24pm by Megan Bullington
    Megan Bullington
    6,245 Points
    • iOS
    • Swift Functions and Optionals
    • Optionals
    • Optional Chaining

    1 Answer

  • Dana Feldman
    Dana Feldman
    4,475 Points

    Besides for the purpose of this video example of Optionals does func sendNoticeto have to be an Int?

    Posted January 10, 2015 9:29pm by Dana Feldman
    Dana Feldman
    4,475 Points
    • iOS
    • Swift Functions and Optionals
    • Optionals
    • Optional Chaining

    1 Answer

  • ryan weeber
    PLUS
    ryan weeber
    Courses Plus Student 1,082 Points

    Why can't we say if var = //optional unwrapping We can only use if let. Thank you.

    Posted January 9, 2015 9:24pm by ryan weeber
    ryan weeber
    Courses Plus Student 1,082 Points
    • iOS
    • Swift Functions and Optionals
    • Optionals
    • Optional Chaining

    1 Answer

  • Morten Engervik
    Morten Engervik
    1,420 Points

    I get this error in the example with optionals/optionals chaining:

    Posted December 1, 2014 7:09am by Morten Engervik
    Morten Engervik
    1,420 Points
    • iOS
    • Swift Functions and Optionals
    • Optionals
    • Optional Chaining

    2 Answers

  • Jason Hernandez Berland
    Jason Hernandez Berland
    1,575 Points

    Why use the ! operator?

    Posted November 21, 2014 6:16pm by Jason Hernandez Berland
    Jason Hernandez Berland
    1,575 Points
    • iOS
    • Swift Functions and Optionals
    • Optionals
    • Optional Chaining

    3 Answers

  • Burak Boysan
    Burak Boysan
    1,205 Points

    I want to reach the input of a function.

    Posted November 13, 2014 12:11pm by Burak Boysan
    Burak Boysan
    1,205 Points
    • iOS
    • Swift Functions and Optionals
    • Optionals
    • Optional Chaining

    1 Answer

  • Pierre-Emmanuel Turcotte
    Pierre-Emmanuel Turcotte
    13,670 Points

    Why no if Let unwrapper to use sendNotice() after chaining ToInt to findApt("101")?

    Posted November 10, 2014 2:56pm by Pierre-Emmanuel Turcotte
    Pierre-Emmanuel Turcotte
    13,670 Points
    • iOS
    • Swift Functions and Optionals
    • Optionals
    • Optional Chaining

    1 Answer

  • Javier Cambon Sanjurjo
    Javier Cambon Sanjurjo
    1,482 Points

    Why aren't all the types just optional by default?

    Posted October 27, 2014 4:37am by Javier Cambon Sanjurjo
    Javier Cambon Sanjurjo
    1,482 Points
    • iOS
    • Swift Functions and Optionals
    • Optionals
    • Optional Chaining

    2 Answers

  • Alex Atwater
    Alex Atwater
    2,624 Points

    What’s the difference between doing findApt(β€œβ€)?.toInt() and findApt(β€œβ€)!.toInt() Seems to do same thing...

    Posted October 12, 2014 4:05pm by Alex Atwater
    Alex Atwater
    2,624 Points
    • iOS
    • Swift Functions and Optionals
    • Optionals
    • Optional Chaining

    1 Answer

Posting to the forum is only allowed for members with active accounts.
Please sign in or sign up to post.

Techdegree

  • Front End Web Development
  • Full Stack JavaScript
SEE ALL

Tracks

  • Learn to Code for Beginners
  • Beginning Python
  • Beginning SQL
  • Beginning Java
SEE ALL

Courses

  • JavaScript Basics
  • Intro to HTML & CSS
  • Python Basics
  • CSS Layout
SEE ALL

About Us

  • About
  • Blog
  • Community
  • Stories
  • Contact
  • Gift Card

Explore

  • Plans
  • Affiliates
  • Perks
  • Shop
  • Free Treehouse Near Me
  • Treehouse for Libraries
  • Treehouse for Businesses

Treehouse is an online technology education platform founded in 2011. Treehouse offers more than 700 self-paced, video-based courses in web development, programming, data analysis, design, and AI, plus two project-based bootcamp programs in Front End Web Development and Full Stack JavaScript. Individual Treehouse plans start at $25 per month and include a 7-day free trial. Treehouse serves individual learners, businesses, schools, and public libraries. Cardholders at participating U.S. public libraries can use Treehouse for free. Select Treehouse courses, offered with University Pathways International, are recommended for college credit by ACE and NCCRS. Treehouse learners earn digital certificates for completed Tracks.

Terms & Conditions · Privacy · © 2026 Treehouse Island, Inc.
  • Twitter
  • YouTube
  • Facebook
  • LinkedIn
  • Instagram
  • Discord