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

New No-Code Track! 🚀start learning today!

🌟 Dreaming of a bright future? 🎓 Ask about the Treehouse Scholarship program! 🚀

✨ 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
    • Career Toolbox
    • CodeForward
    • Free Treehouse Near Me
    • Jobs
    • Blog
    • Support
    • About
  • 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
  • Career Toolbox CodeForward Free Treehouse Near Me Jobs Blog Support About
  • Sign In
  • Free Trial
Instagram Twitter Facebook YouTube LinkedIn
    • Newest
      • Newest
      • Active
      • Unanswered
      • Featured
    • All Topics
      • All Topics
      • • General Discussion
      • • AI
      • • Android
      • • 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
  • 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.

    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

© 2025 Treehouse Island, Inc.