Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS Object-Oriented Swift Class Inheritance Overriding Properties

Lucas Morales
Lucas Morales
986 Points

I have no idea what is going on — this was really confusing and demotivating :(

I was following along great up to a couple videos ago. This one in special made me completely confused

Dane Parchment
Dane Parchment
Treehouse Moderator 11,075 Points

What exactly is confusing you? The concept of overriding methods/properties from a super class. The concept of super classes themselves? What exactly is giving you trouble and demotivating you?

2 Answers

Jon Barnett
Jon Barnett
2,004 Points

Hi Lucas, the thing you mention, the naming the example of the new class SuperEnemy, yeah I can see how that might be confusing. So, a walkthrough- The new class is called SuperEnemy (note the capitalisation) The example instance that the instructor creates, he give the name superEnemy. (again note the capitalisation) The two names are similar, but not the same, in fact totally different names, because the different capitalisation is enough to make them totally different. SuperEnemy is the class. superEnemy is the instance of the class.

So the instructor could have created an instance of the class called nastyEnemyThing rather than superEnemy, and maybe it would have been less confusing. But I am sure that he has his reasons.

Lucas Morales
Lucas Morales
986 Points

Building this on top of so much other code just made things more difficult to understand. Naming subclass, superclass where the name is also Super Enemy made things even more difficult ... I have no idea what's going on and am reading articles to understand what I couldn't with the video

the whole concept just became super confusing. Complex and unmotivating for me as well :(