From the course: Make SwiftUI Playgrounds Applications

Unlock this course with a free trial

Join today to access over 25,300 courses taught by industry experts.

Structs and classes

Structs and classes

- [Instructor] You've made your own functions. You've learned how to declare a value for type. Now we'll tie both of those together and make your own types, which as you'll see is at the heart of Swift programming. A general rule about types is they are capitalized words in code. So let's go over here to our code and I'm going to get rid of the preview so we can have a little more space here. And you could start to see a few things. Look at this code and you'll see a lot of things that are capitalized. ContentView, View, Double, String and Text are all types, sometimes referred to as objects. And notice again ContentView, where we define a ContentView object. There's three things you should note about an object. First, an object is a group of values called properties that define that object. bannerImage, color and title are examples in the ContentView object. You'll also find a group of functions called methods that…

Contents