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
  • Amir Shahabnia
    PLUS
    Amir Shahabnia
    Courses Plus Student 29,310 Points

    Optional Binding instead of force unwrapping

    Posted April 27, 2016 10:26pm by Amir Shahabnia
    Amir Shahabnia
    Courses Plus Student 29,310 Points
    • iOS
    • Build a Playlist Browser with Swift
    • Building the Music Library and Playlist Models
    • Struct Initialization

    0 Answers

  • zhengyangdong
    zhengyangdong
    2,623 Points

    In Swift 2.0, shall I use as! or as?

    Posted January 25, 2016 4:13pm by zhengyangdong
    zhengyangdong
    2,623 Points
    • iOS
    • Build a Playlist Browser with Swift
    • Building the Music Library and Playlist Models
    • Struct Initialization

    1 Answer

  • TheBigoso /\
    TheBigoso /\
    3,217 Points

    Struct Initialization Video - Error with "largeIcon" and "assets +="

    Posted October 21, 2015 10:36pm by TheBigoso /\
    TheBigoso /\
    3,217 Points
    • iOS
    • Build a Playlist Browser with Swift
    • Building the Music Library and Playlist Models
    • Struct Initialization

    1 Answer

  • Martin Foldyna
    Martin Foldyna
    10,359 Points

    Swift index error

    Posted October 15, 2015 3:16pm by Martin Foldyna
    Martin Foldyna
    10,359 Points
    • iOS
    • Build a Playlist Browser with Swift
    • Building the Music Library and Playlist Models
    • Struct Initialization

    1 Answer

  • samanthabourdeau
    samanthabourdeau
    9,585 Points

    Swift CompilerError

    Posted September 14, 2015 2:20am by samanthabourdeau
    samanthabourdeau
    9,585 Points
    • iOS
    • Build a Playlist Browser with Swift
    • Building the Music Library and Playlist Models
    • Struct Initialization

    0 Answers

  • thomas lotocki
    thomas lotocki
    3,230 Points

    Slow down!

    Posted September 6, 2015 10:36am by thomas lotocki
    thomas lotocki
    3,230 Points
    • iOS
    • Build a Playlist Browser with Swift
    • Building the Music Library and Playlist Models
    • Struct Initialization

    1 Answer

  • Jimmy Fisher
    seal-mask
    .a{fill-rule:evenodd;}techdegree
    Jimmy Fisher
    iOS Development Techdegree Student 3,183 Points

    Cannot subscript a value of type '[NSDictionary]'

    Posted September 2, 2015 4:24pm by Jimmy Fisher
    .a{fill-rule:evenodd;}techdegree
    Jimmy Fisher
    iOS Development Techdegree Student 3,183 Points
    • iOS
    • Build a Playlist Browser with Swift
    • Building the Music Library and Playlist Models
    • Struct Initialization

    2 Answers

  • maq
    maq
    1,297 Points

    Use of unresolved identifier 'musicLibrary'

    Posted August 30, 2015 1:53am by maq
    maq
    1,297 Points
    • iOS
    • Build a Playlist Browser with Swift
    • Building the Music Library and Playlist Models
    • Struct Initialization

    1 Answer

  • Michael Zaro
    Michael Zaro
    13,196 Points

    Binary operator += cannot be applied to types '[String]' and 'String'???

    Posted August 18, 2015 8:34pm by Michael Zaro
    Michael Zaro
    13,196 Points
    • iOS
    • Build a Playlist Browser with Swift
    • Building the Music Library and Playlist Models
    • Struct Initialization

    5 Answers

  • Deepa Laxmi
    Deepa Laxmi
    3,035 Points

    fatal error: unexpectedly found nil while unwrapping an Optional value

    Posted July 27, 2015 10:56am by Deepa Laxmi
    Deepa Laxmi
    3,035 Points
    • iOS
    • Build a Playlist Browser with Swift
    • Building the Music Library and Playlist Models
    • Struct Initialization

    0 Answers

  • Ian Donovan
    Ian Donovan
    3,166 Points

    Xcode 6.4, as! v. as?, String! v. String!

    Posted July 17, 2015 8:48pm by Ian Donovan
    Ian Donovan
    3,166 Points
    • iOS
    • Build a Playlist Browser with Swift
    • Building the Music Library and Playlist Models
    • Struct Initialization

    0 Answers

  • S B
    S B
    4,497 Points

    Why is the UI Image Initialization treated different from the title and description initializations?

    Posted July 8, 2015 1:20pm by S B
    S B
    4,497 Points
    • iOS
    • Build a Playlist Browser with Swift
    • Building the Music Library and Playlist Models
    • Struct Initialization

    1 Answer

  • Matt George
    Matt George
    2,507 Points

    Can someone please explain the core concepts that were taught in this video more simply?

    Posted July 2, 2015 8:08pm by Matt George
    Matt George
    2,507 Points
    • iOS
    • Build a Playlist Browser with Swift
    • Building the Music Library and Playlist Models
    • Struct Initialization

    3 Answers

  • pixelation
    PLUS
    pixelation
    Courses Plus Student 4,219 Points

    Still getting tons of errors in the init method, can't fix it?

    Posted July 1, 2015 3:55pm by pixelation
    pixelation
    Courses Plus Student 4,219 Points
    • iOS
    • Build a Playlist Browser with Swift
    • Building the Music Library and Playlist Models
    • Struct Initialization

    1 Answer

  • carlosdiaz11
    carlosdiaz11
    1,810 Points

    I am getting errors downcasting "Did you mean to use as! to force downcast?

    Posted May 28, 2015 6:25pm by carlosdiaz11
    carlosdiaz11
    1,810 Points
    • iOS
    • Build a Playlist Browser with Swift
    • Building the Music Library and Playlist Models
    • Struct Initialization

    1 Answer

  • Shintaro Fukagawa
    Shintaro Fukagawa
    3,339 Points

    why arent we using self. to initialize the properties?

    Posted May 27, 2015 7:30am by Shintaro Fukagawa
    Shintaro Fukagawa
    3,339 Points
    • iOS
    • Build a Playlist Browser with Swift
    • Building the Music Library and Playlist Models
    • Struct Initialization

    1 Answer

  • Samar Khanna
    Samar Khanna
    1,757 Points

    Why aren't we unwrapping the array?

    Posted May 2, 2015 7:52pm by Samar Khanna
    Samar Khanna
    1,757 Points
    • iOS
    • Build a Playlist Browser with Swift
    • Building the Music Library and Playlist Models
    • Struct Initialization

    0 Answers

  • brent rogers
    brent rogers
    2,159 Points

    why do we add the () in the following let musicLibrary = MusicLibrary().library

    Posted May 1, 2015 5:15pm by brent rogers
    brent rogers
    2,159 Points
    • iOS
    • Build a Playlist Browser with Swift
    • Building the Music Library and Playlist Models
    • Struct Initialization

    2 Answers

  • Paulo Braga
    Paulo Braga
    5,381 Points

    Why use "as" in "title = playlistDictionary["title"] as String!"?

    Posted April 15, 2015 4:49pm by Paulo Braga
    Paulo Braga
    5,381 Points
    • iOS
    • Build a Playlist Browser with Swift
    • Building the Music Library and Playlist Models
    • Struct Initialization

    2 Answers

  • Huu Nguyen
    Huu Nguyen
    2,585 Points

    It's giving me an AnyObject? error and suggests i fix it with as!. Why do I need this in addition to String!?

    Posted April 13, 2015 1:14am by Huu Nguyen
    Huu Nguyen
    2,585 Points
    • iOS
    • Build a Playlist Browser with Swift
    • Building the Music Library and Playlist Models
    • Struct Initialization

    4 Answers

  • Jeff Lange
    Jeff Lange
    4,791 Points

    Lots of errors in my init method: 'AnyObject?' is not convertible to 'String!'

    Posted April 11, 2015 4:48pm by Jeff Lange
    Jeff Lange
    4,791 Points
    • iOS
    • Build a Playlist Browser with Swift
    • Building the Music Library and Playlist Models
    • Struct Initialization

    2 Answers

  • Philip Ondrejack
    Philip Ondrejack
    4,287 Points

    Why do we have to create a helper method?

    Posted April 5, 2015 4:46pm by Philip Ondrejack
    Philip Ondrejack
    4,287 Points
    • iOS
    • Build a Playlist Browser with Swift
    • Building the Music Library and Playlist Models
    • Struct Initialization

    2 Answers

  • ivanzdane
    ivanzdane
    6,541 Points

    Optional unwrapping not working

    Posted March 17, 2015 9:27pm by ivanzdane
    ivanzdane
    6,541 Points
    • iOS
    • Build a Playlist Browser with Swift
    • Building the Music Library and Playlist Models
    • Struct Initialization

    1 Answer

  • Hyun Seo Chung
    Hyun Seo Chung
    2,239 Points

    What is "as"?

    Posted February 22, 2015 11:54am by Hyun Seo Chung
    Hyun Seo Chung
    2,239 Points
    • iOS
    • Build a Playlist Browser with Swift
    • Building the Music Library and Playlist Models
    • Struct Initialization

    1 Answer

  • tytyty
    tytyty
    4,974 Points

    You said "Rather than hard coding the index value we can pass in the function argument or the method argument".

    Posted February 13, 2015 6:18am by tytyty
    tytyty
    4,974 Points
    • iOS
    • Build a Playlist Browser with Swift
    • Building the Music Library and Playlist Models
    • Struct Initialization

    0 Answers

  • Aman Kansal
    Aman Kansal
    2,966 Points

    title = playlistDictionary["title"] as String! I am getting '(String, NSObject) is not convertible to String' error?

    Posted February 9, 2015 8:25pm by Aman Kansal
    Aman Kansal
    2,966 Points
    • iOS
    • Build a Playlist Browser with Swift
    • Building the Music Library and Playlist Models
    • Struct Initialization

    4 Answers

  • Matt Porter
    Matt Porter
    2,192 Points

    Accessing data of the internet

    Posted February 3, 2015 5:18pm by Matt Porter
    Matt Porter
    2,192 Points
    • iOS
    • Build a Playlist Browser with Swift
    • Building the Music Library and Playlist Models
    • Struct Initialization

    0 Answers

  • jamiefang
    jamiefang
    10,798 Points

    Why don't we unwrap anything when we cast playlistDictionary["artists"] as [String]?

    Posted January 24, 2015 10:17am by jamiefang
    jamiefang
    10,798 Points
    • iOS
    • Build a Playlist Browser with Swift
    • Building the Music Library and Playlist Models
    • Struct Initialization

    1 Answer

  • Nadaa Taiyab
    Nadaa Taiyab
    2,074 Points

    PlayList App

    Posted January 21, 2015 8:12pm by Nadaa Taiyab
    Nadaa Taiyab
    2,074 Points
    • iOS
    • Build a Playlist Browser with Swift
    • Building the Music Library and Playlist Models
    • Struct Initialization

    0 Answers

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