❄️ Winter Sale - Ends Soon! ❄️ Take 50% off your first 6 months! (new subscribers only, renews at regular price).

Join the Treehouse affiliate program and earn 25% recurring commission!

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

  • Treehouse Logo
  • Plans
    Chevron
    • For Individuals
    • For Businesses
    • For Schools
    • For Libraries
    • For Military
  • Library
    Chevron
    • All Courses
    • Tracks
    • College Credit
  • Techdegree
    Chevron
    • Overview
    • Front End Development
    • Full Stack JavaScript
    • Data Analysis
    • UX Design
    • Python
  • Community
    Chevron
    • Code Adventures
    • Discord
    • Forum
    • Success Stories
    • Treehouse Links
    • 100 Days of Code
  • Resources
    Chevron
    • Explore
    • Career Toolbox
    • CodeForward
    • Free Treehouse Near Me
    • Jobs
    • 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 College Credit
  • Overview Front End Web Development Full Stack JavaScript Python Development Data Analysis UX Design
  • Code Adventures Discord Forum Success Stories Treehouse Links 100 Days of Code
  • Explore Career Toolbox CodeForward Free Treehouse Near Me Jobs 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
    • 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
  • Nikita Voloboev
    Nikita Voloboev
    4,816 Points

    Why does my IDE not show culprit to have an optional value even though I have String? in the return declaration?

    Posted May 13, 2016 12:56pm by Nikita Voloboev
    Nikita Voloboev
    4,816 Points
    • iOS
    • Swift Functions and Optionals
    • Optionals
    • What is an Optional?

    0 Answers

  • James Killeen
    PLUS
    James Killeen
    Courses Plus Student 2,207 Points

    Version 7.3. Hi All, I'm finding it very difficult to follow along with my version of Xcode 7.3

    Posted April 15, 2016 3:38am by James Killeen
    James Killeen
    Courses Plus Student 2,207 Points
    • iOS
    • Swift Functions and Optionals
    • Optionals
    • What is an Optional?

    1 Answer

  • Thomas Katalenas
    Thomas Katalenas
    11,033 Points

    A crash while on treehouse today lol coincidence?

    Posted February 2, 2016 8:43pm by Thomas Katalenas
    Thomas Katalenas
    11,033 Points
    • iOS
    • Swift Functions and Optionals
    • Optionals
    • What is an Optional?

    2 Answers

  • Sujoy Singh
    Sujoy Singh
    10,620 Points

    '=' used instead of '==' in an if statement.

    Posted January 13, 2016 6:54am by Sujoy Singh
    Sujoy Singh
    10,620 Points
    • iOS
    • Swift Functions and Optionals
    • Optionals
    • What is an Optional?

    1 Answer

  • Kashish Singal
    Kashish Singal
    3,368 Points

    if let culprit = findApt("505"){}

    Posted December 20, 2015 7:34pm by Kashish Singal
    Kashish Singal
    3,368 Points
    • iOS
    • Swift Functions and Optionals
    • Optionals
    • What is an Optional?

    3 Answers

  • Ramon Hurtado
    Ramon Hurtado
    1,416 Points

    Okay just a quick question to clarify so when you type the func why do you have to do "-> String?"

    Posted December 3, 2015 4:08am by Ramon Hurtado
    Ramon Hurtado
    1,416 Points
    • iOS
    • Swift Functions and Optionals
    • Optionals
    • What is an Optional?

    1 Answer

  • Antonio Montalvo
    Antonio Montalvo
    10,549 Points

    Problem executing the code provided at Swift Functions and Optionals

    Posted November 9, 2015 9:31pm by Antonio Montalvo
    Antonio Montalvo
    10,549 Points
    • iOS
    • Swift Functions and Optionals
    • Optionals
    • What is an Optional?

    1 Answer

  • NOUR A ALGHAMDI
    PLUS
    NOUR A ALGHAMDI
    Courses Plus Student 5,607 Points

    pleas Help :\ don't Know what is the problem :(

    Posted October 3, 2015 9:10pm by NOUR A ALGHAMDI
    NOUR A ALGHAMDI
    Courses Plus Student 5,607 Points
    • iOS
    • Swift Functions and Optionals
    • Optionals
    • What is an Optional?

    2 Answers

  • boris said
    boris said
    3,607 Points

    Kinda stuck getting this weird error

    Posted August 26, 2015 1:41pm by boris said
    boris said
    3,607 Points
    • iOS
    • Swift Functions and Optionals
    • Optionals
    • What is an Optional?

    1 Answer

  • Joel Malpica
    Joel Malpica
    2,873 Points

    Why on my sidebar does it just say "404" and not {some "404"}?

    Posted August 8, 2015 3:30pm by Joel Malpica
    Joel Malpica
    2,873 Points
    • iOS
    • Swift Functions and Optionals
    • Optionals
    • What is an Optional?

    3 Answers

  • Kieran Roberts
    Kieran Roberts
    8,355 Points

    Pretty stuck on this one. Can somebody please show me the code so I can workout where I am going wrong, cheers.

    Posted August 1, 2015 9:43am by Kieran Roberts
    Kieran Roberts
    8,355 Points
    • iOS
    • Swift Functions and Optionals
    • Optionals
    • What is an Optional?

    1 Answer

  • Johnny Manning
    Johnny Manning
    1,079 Points

    My XCode returns the string "404" and not {some "404"} as it does in the video (before I've entered the !) Why?

    Posted July 31, 2015 10:20am by Johnny Manning
    Johnny Manning
    1,079 Points
    • iOS
    • Swift Functions and Optionals
    • Optionals
    • What is an Optional?

    1 Answer

  • Lauren Hibbs
    Lauren Hibbs
    1,872 Points

    Swift 1.2 and Optionals?

    Posted July 19, 2015 9:12pm by Lauren Hibbs
    Lauren Hibbs
    1,872 Points
    • iOS
    • Swift Functions and Optionals
    • Optionals
    • What is an Optional?

    1 Answer

  • Guilherme Kunzler
    Guilherme Kunzler
    1,433 Points

    Is this a good solution as well?

    Posted June 20, 2015 2:03am by Guilherme Kunzler
    Guilherme Kunzler
    1,433 Points
    • iOS
    • Swift Functions and Optionals
    • Optionals
    • What is an Optional?

    0 Answers

  • Justin Bower
    PLUS
    Justin Bower
    Courses Plus Student 4,682 Points

    Did Apple drop convention of putting "Some" in front of optionals?

    Posted June 3, 2015 11:57pm by Justin Bower
    Justin Bower
    Courses Plus Student 4,682 Points
    • iOS
    • Swift Functions and Optionals
    • Optionals
    • What is an Optional?

    1 Answer

  • Ryan Ferguson
    Ryan Ferguson
    4,786 Points

    Exact same code; not getting a struct.

    Posted May 23, 2015 3:06am by Ryan Ferguson
    Ryan Ferguson
    4,786 Points
    • iOS
    • Swift Functions and Optionals
    • Optionals
    • What is an Optional?

    2 Answers

  • Paula Samuels
    Paula Samuels
    1,853 Points

    What in the world does "unwrapping an optional" mean?

    Posted May 22, 2015 7:29pm by Paula Samuels
    Paula Samuels
    1,853 Points
    • iOS
    • Swift Functions and Optionals
    • Optionals
    • What is an Optional?

    1 Answer

  • Christopher Mayfield
    Christopher Mayfield
    19,928 Points

    when I replicate his code, I don't get a struct.

    Posted May 10, 2015 11:19pm by Christopher Mayfield
    Christopher Mayfield
    19,928 Points
    • iOS
    • Swift Functions and Optionals
    • Optionals
    • What is an Optional?

    3 Answers

  • Robert Mylne
    Robert Mylne
    13,708 Points

    Return nil vs return false

    Posted April 26, 2015 11:29am by Robert Mylne
    Robert Mylne
    13,708 Points
    • iOS
    • Swift Functions and Optionals
    • Optionals
    • What is an Optional?

    1 Answer

  • Samar Khanna
    Samar Khanna
    1,757 Points

    Understanding nil

    Posted April 20, 2015 4:10pm by Samar Khanna
    Samar Khanna
    1,757 Points
    • iOS
    • Swift Functions and Optionals
    • Optionals
    • What is an Optional?

    1 Answer

  • Hunter Christian Davis
    Hunter Christian Davis
    2,813 Points

    Optionals

    Posted March 28, 2015 3:16pm by Hunter Christian Davis
    Hunter Christian Davis
    2,813 Points
    • iOS
    • Swift Functions and Optionals
    • Optionals
    • What is an Optional?

    1 Answer

  • Jose Maldonado
    Jose Maldonado
    623 Points

    About Optionals

    Posted March 27, 2015 11:05pm by Jose Maldonado
    Jose Maldonado
    623 Points
    • iOS
    • Swift Functions and Optionals
    • Optionals
    • What is an Optional?

    1 Answer

  • Hunter Christian Davis
    Hunter Christian Davis
    2,813 Points

    Optional question

    Posted March 27, 2015 10:35pm by Hunter Christian Davis
    Hunter Christian Davis
    2,813 Points
    • iOS
    • Swift Functions and Optionals
    • Optionals
    • What is an Optional?

    1 Answer

  • Martin Langeder
    Martin Langeder
    3,335 Points

    if culprint != nil

    Posted March 19, 2015 10:50am by Martin Langeder
    Martin Langeder
    3,335 Points
    • iOS
    • Swift Functions and Optionals
    • Optionals
    • What is an Optional?

    1 Answer

  • James Stott
    James Stott
    11,560 Points

    How does `let name = value` resolve to a boolean?

    Posted February 16, 2015 10:28pm by James Stott
    James Stott
    11,560 Points
    • iOS
    • Swift Functions and Optionals
    • Optionals
    • What is an Optional?

    2 Answers

  • spalak
    spalak
    12,151 Points

    Why does the if statement return a string?

    Posted November 2, 2014 6:29am by spalak
    spalak
    12,151 Points
    • iOS
    • Swift Functions and Optionals
    • Optionals
    • What is an Optional?

    3 Answers

  • Benjamin Bell
    Benjamin Bell
    4,364 Points

    Swift vs Scala

    Posted October 29, 2014 8:10pm by Benjamin Bell
    Benjamin Bell
    4,364 Points
    • iOS
    • Swift Functions and Optionals
    • Optionals
    • What is an Optional?

    1 Answer

  • Ed Williams
    Ed Williams
    2,969 Points

    Why not return a tuple (Bool, String) instead of an optional String?

    Posted October 19, 2014 12:34pm by Ed Williams
    Ed Williams
    2,969 Points
    • iOS
    • Swift Functions and Optionals
    • Optionals
    • What is an Optional?

    3 Answers

  • Matthew Chana
    Matthew Chana
    1,063 Points

    Why doesn't the 'culprit' constant in the if let conditional require a "==" (is equal to)?

    Posted October 13, 2014 4:48pm by Matthew Chana
    Matthew Chana
    1,063 Points
    • iOS
    • Swift Functions and Optionals
    • Optionals
    • What is an Optional?

    3 Answers

  • George Hamilton
    George Hamilton
    2,777 Points

    Is this correct? The if let syntax creates the culprit constant and assigns it the return value only if the value != nil

    Posted October 6, 2014 11:24pm by George Hamilton
    George Hamilton
    2,777 Points
    • iOS
    • Swift Functions and Optionals
    • Optionals
    • What is an Optional?

    1 Answer

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

    Treehouse

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

See Full Catalogue

Techdegree

  • Front End Web Development
  • Full Stack JavaScript
  • Python Development
  • Data Analysis
  • UX Design

Tracks

  • Learn to Code for Beginners
  • Beginning Python
  • Beginning SQL
  • Beginning Java
  • ...see more

Courses

  • JavaScript Basics
  • Intro to HTML & CSS
  • Python Basics
  • CSS Layout
  • ...see more

Explore

  • Plans
  • Affiliates
  • Perks
  • Free Treehouse Near Me
  • Treehouse for Libraries
  • Treehouse for Businesses
  • Twitter
  • YouTube
  • Facebook
  • LinkedIn
  • Instagram
Terms & Conditions | Privacy

© 2026 Treehouse Island, Inc.