🤑 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
  • 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.

    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.