Welcome to the Treehouse Community
Looking to learn something new?
jon kelson5,149 Points
Structs and class in object swift
Hi all, in the set of videos object oriented swift . Just for arguments sake could the struct that Pasan made, be a class and the classes been struts ? I'm guessing he just made them different just to show us the difference . ?
Just to answer your question.. Yes he could have.. But depending on your project you may want to know which one to use. IN a more general Idea, structs are the way to go, but keep in mind that classes are powerful because of their inheritance. One is a reference type (class), and the other one is value type (struct).