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.

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

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

  • 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
  • Huseyn Guliyev
    Huseyn Guliyev
    2,603 Points

    Error in vend function

    Posted March 23, 2020 7:05pm by Huseyn Guliyev
    Huseyn Guliyev
    2,603 Points
    • iOS
    • Build a Vending Machine App in Swift
    • Using the Vending Machine
    • Modeling the Vending Machine

    1 Answer

  • Huseyn Guliyev
    Huseyn Guliyev
    2,603 Points

    An error is given when I try to run the app

    Posted September 4, 2019 2:30pm by Huseyn Guliyev
    Huseyn Guliyev
    2,603 Points
    • iOS
    • Build a Vending Machine App in Swift
    • Using the Vending Machine
    • Updating the Price

    0 Answers

  • Shawn Tsou
    PLUS
    Shawn Tsou
    Courses Plus Student 2,281 Points

    Forward Button on Keyboard

    Posted January 10, 2019 6:52pm by Shawn Tsou
    Shawn Tsou
    Courses Plus Student 2,281 Points
    • iOS
    • Build a Vending Machine App in Swift
    • Using the Vending Machine
    • Displaying Icons with UIImage

    0 Answers

  • Matthew Ingram
    PLUS
    Matthew Ingram
    Courses Plus Student 4,718 Points

    How to practice before moving on?

    Posted July 11, 2018 9:38pm by Matthew Ingram
    Matthew Ingram
    Courses Plus Student 4,718 Points
    • iOS
    • Build a Vending Machine App in Swift
    • Using the Vending Machine
    • Updating the Price

    1 Answer

  • Ahmed Jaboub
    Ahmed Jaboub
    2,272 Points

    When I try to return default it disappears and it doesn't show up unless I press command(it returns a blue ? icon).

    Posted April 29, 2018 8:58pm by Ahmed Jaboub
    Ahmed Jaboub
    2,272 Points
    • iOS
    • Build a Vending Machine App in Swift
    • Using the Vending Machine
    • Displaying Icons with UIImage

    1 Answer

  • Rea Rahhal
    PLUS
    Rea Rahhal
    Courses Plus Student 4,732 Points

    Use of unresolved identifier totalPrice? what's wrong

    Posted April 12, 2018 11:20am by Rea Rahhal
    Rea Rahhal
    Courses Plus Student 4,732 Points
    • iOS
    • Build a Vending Machine App in Swift
    • Using the Vending Machine
    • Updating the Quantity

    1 Answer

  • Rea Rahhal
    PLUS
    Rea Rahhal
    Courses Plus Student 4,732 Points

    Cannot assign value of type 'VendingSelection' to type 'VendingMachine?'

    Posted April 12, 2018 6:51am by Rea Rahhal
    Rea Rahhal
    Courses Plus Student 4,732 Points
    • iOS
    • Build a Vending Machine App in Swift
    • Using the Vending Machine
    • Modeling the Vending Machine

    1 Answer

  • Max F
    Max F
    9,900 Points

    Swift Vending Machine App Not Printing Stepper

    Posted December 22, 2017 8:56pm by Max F
    Max F
    9,900 Points
    • iOS
    • Build a Vending Machine App in Swift
    • Using the Vending Machine
    • Working with Steppers

    1 Answer

  • Nick Johnson
    Nick Johnson
    2,345 Points

    Why use guard instead of an if statement?

    Posted December 10, 2017 2:10am by Nick Johnson
    Nick Johnson
    2,345 Points
    • iOS
    • Build a Vending Machine App in Swift
    • Using the Vending Machine
    • Modeling the Vending Machine

    0 Answers

  • Jesse Gay
    seal-mask
    .a{fill-rule:evenodd;}techdegree
    Jesse Gay
    Full Stack JavaScript Techdegree Student 14,045 Points

    When I enter default, it disappears, then crashes

    Posted November 21, 2017 1:21am by Jesse Gay
    .a{fill-rule:evenodd;}techdegree
    Jesse Gay
    Full Stack JavaScript Techdegree Student 14,045 Points
    • iOS
    • Build a Vending Machine App in Swift
    • Using the Vending Machine
    • Displaying Icons with UIImage

    10 Answers

  • Ryan Forte
    seal-mask
    .a{fill-rule:evenodd;}techdegree
    Ryan Forte
    iOS Development Techdegree Student 2,955 Points

    Trouble linking back

    Posted November 16, 2017 1:42am by Ryan Forte
    .a{fill-rule:evenodd;}techdegree
    Ryan Forte
    iOS Development Techdegree Student 2,955 Points
    • iOS
    • Build a Vending Machine App in Swift
    • Using the Vending Machine
    • Modeling the Vending Machine

    2 Answers

  • Alex Constancio
    Alex Constancio
    2,745 Points

    I keep getting an error whenever I try to access quantityStepper.value it tells me "Ambiguous use of 'value'"

    Posted November 7, 2017 4:42am by Alex Constancio
    Alex Constancio
    2,745 Points
    • iOS
    • Build a Vending Machine App in Swift
    • Using the Vending Machine
    • Updating the Quantity

    0 Answers

  • Gavin Hobbs
    Gavin Hobbs
    5,205 Points

    Use of unresolved identifier 'quantity'

    Posted November 6, 2017 2:57pm by Gavin Hobbs
    Gavin Hobbs
    5,205 Points
    • iOS
    • Build a Vending Machine App in Swift
    • Using the Vending Machine
    • Testing Out the Vending Machine

    1 Answer

  • HsinTing Hsieh
    HsinTing Hsieh
    4,115 Points

    get error of optional type VendingSelection?

    Posted October 14, 2017 5:42am by HsinTing Hsieh
    HsinTing Hsieh
    4,115 Points
    • iOS
    • Build a Vending Machine App in Swift
    • Using the Vending Machine
    • Updating the Price

    1 Answer

  • jordon beyond
    jordon beyond
    2,158 Points

    Quantity problem in Vending Machine code

    Posted September 10, 2017 5:15am by jordon beyond
    jordon beyond
    2,158 Points
    • iOS
    • Build a Vending Machine App in Swift
    • Using the Vending Machine
    • Testing Out the Vending Machine

    2 Answers

  • Zenek Barburka
    Zenek Barburka
    7,009 Points

    Let's chenge the name....????

    Posted June 18, 2017 1:20pm by Zenek Barburka
    Zenek Barburka
    7,009 Points
    • iOS
    • Build a Vending Machine App in Swift
    • Using the Vending Machine
    • Testing Out the Vending Machine

    3 Answers

  • Julian Gu
    Julian Gu
    12,490 Points

    Shouldn't you change the currentSelection to nil after hitting the purchase button?

    Posted June 9, 2017 5:36am by Julian Gu
    Julian Gu
    12,490 Points
    • iOS
    • Build a Vending Machine App in Swift
    • Using the Vending Machine
    • Updating the Price

    1 Answer

  • David Miller
    David Miller
    5,118 Points

    My labels are not being populated when you click an item in the vending machine.

    Posted January 26, 2017 10:26am by David Miller
    David Miller
    5,118 Points
    • iOS
    • Build a Vending Machine App in Swift
    • Using the Vending Machine
    • Updating the Price

    1 Answer

  • Joshua Walker
    Joshua Walker
    2,547 Points

    Build vending machine crash when hitting the purchase button, Whats happening?

    Posted December 30, 2016 10:01pm by Joshua Walker
    Joshua Walker
    2,547 Points
    • iOS
    • Build a Vending Machine App in Swift
    • Using the Vending Machine
    • Updating the Price

    5 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