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
  • Lionel Coelho
    Lionel Coelho
    1,206 Points

    Going a bit nuts here...

    Posted November 8, 2016 2:50am by Lionel Coelho
    Lionel Coelho
    1,206 Points
    • iOS
    • Object-Oriented Swift 2.0
    • Classes
    • Helper Methods

    1 Answer

  • Jack Colosky
    PLUS
    Jack Colosky
    Courses Plus Student 2,263 Points

    When I call the fireAtEnemy method on the instance tower, I get the error expected declaration

    Posted August 16, 2016 1:58pm by Jack Colosky
    Jack Colosky
    Courses Plus Student 2,263 Points
    • iOS
    • Object-Oriented Swift 2.0
    • Classes
    • Helper Methods

    1 Answer

  • Lana Wong
    Lana Wong
    3,968 Points

    I do not understand

    Posted August 11, 2016 2:56am by Lana Wong
    Lana Wong
    3,968 Points
    • iOS
    • Object-Oriented Swift 2.0
    • Classes
    • Helper Methods

    1 Answer

  • Danny Kilkenny
    Danny Kilkenny
    4,507 Points

    Why self.strength instead of just strength

    Posted August 3, 2016 1:43am by Danny Kilkenny
    Danny Kilkenny
    4,507 Points
    • iOS
    • Object-Oriented Swift 2.0
    • Classes
    • Helper Methods

    1 Answer

  • Mark Houston
    Mark Houston
    11,782 Points

    Type '(withRange: Int) -> [Point]' does not conform to protocol 'SequenceType'

    Posted July 26, 2016 2:11am by Mark Houston
    Mark Houston
    11,782 Points
    • iOS
    • Object-Oriented Swift 2.0
    • Classes
    • Helper Methods

    0 Answers

  • Elijah Florence
    PLUS
    Elijah Florence
    Courses Plus Student 3,225 Points

    Error in Playground, not sure why?

    Posted June 7, 2016 4:49am by Elijah Florence
    Elijah Florence
    Courses Plus Student 3,225 Points
    • iOS
    • Object-Oriented Swift 2.0
    • Classes
    • Helper Methods

    5 Answers

  • Adam Tatusko
    Adam Tatusko
    16,589 Points

    Vanquished Enemy

    Posted June 1, 2016 7:58pm by Adam Tatusko
    Adam Tatusko
    16,589 Points
    • iOS
    • Object-Oriented Swift 2.0
    • Classes
    • Helper Methods

    3 Answers

  • RAJ PATEL
    RAJ PATEL
    4,282 Points

    So I'm kinda confused with the structure and classes and I dont really understand completely how they work.

    Posted April 1, 2016 7:30am by RAJ PATEL
    RAJ PATEL
    4,282 Points
    • iOS
    • Object-Oriented Swift 2.0
    • Classes
    • Helper Methods

    1 Answer

  • Min Choi
    Min Choi
    1,517 Points

    How does my if else statement know whether my function is true or false.

    Posted March 17, 2016 5:51am by Min Choi
    Min Choi
    1,517 Points
    • iOS
    • Object-Oriented Swift 2.0
    • Classes
    • Helper Methods

    1 Answer

  • Sacha Karsenty
    Sacha Karsenty
    3,903 Points

    Why does it mean that the target position is in range? Sorry for the long explanation but I hope you guys can help me.

    Posted March 11, 2016 9:24am by Sacha Karsenty
    Sacha Karsenty
    3,903 Points
    • iOS
    • Object-Oriented Swift 2.0
    • Classes
    • Helper Methods

    2 Answers

  • Kylie Forbes
    Kylie Forbes
    3,405 Points

    "Value type of 'Tower' has no member 'fireAtEnemy'" error

    Posted February 11, 2016 8:10pm by Kylie Forbes
    Kylie Forbes
    3,405 Points
    • iOS
    • Object-Oriented Swift 2.0
    • Classes
    • Helper Methods

    2 Answers

  • Matthew Durante
    Matthew Durante
    1,228 Points

    I am forced to initialize the variables as well else I get a 'return from initializer without initializing all stored...

    Posted February 3, 2016 3:27am by Matthew Durante
    Matthew Durante
    1,228 Points
    • iOS
    • Object-Oriented Swift 2.0
    • Classes
    • Helper Methods

    0 Answers

  • Ced I
    Ced I
    999 Points

    Code seems to break when creating an enemy out of the range of the Tower

    Posted January 25, 2016 9:34am by Ced I
    Ced I
    999 Points
    • iOS
    • Object-Oriented Swift 2.0
    • Classes
    • Helper Methods

    0 Answers

  • Guled Ahmed
    Guled Ahmed
    12,806 Points

    Tip: Another way of writing the inRange function.

    Posted January 19, 2016 5:13pm by Guled Ahmed
    Guled Ahmed
    12,806 Points
    • iOS
    • Object-Oriented Swift 2.0
    • Classes
    • Helper Methods

    0 Answers

  • Darren Coburn
    Darren Coburn
    4,297 Points

    Why can't I use the instance of my class?

    Posted December 23, 2015 8:16am by Darren Coburn
    Darren Coburn
    4,297 Points
    • iOS
    • Object-Oriented Swift 2.0
    • Classes
    • Helper Methods

    3 Answers

  • Kim Sorgalla
    Kim Sorgalla
    2,174 Points

    Will I ever understand this?!

    Posted November 15, 2015 6:05pm by Kim Sorgalla
    Kim Sorgalla
    2,174 Points
    • iOS
    • Object-Oriented Swift 2.0
    • Classes
    • Helper Methods

    16 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