From the course: iOS 14 Development Essential Training

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Modifying fonts and spacing in SwiftUI

Modifying fonts and spacing in SwiftUI

From the course: iOS 14 Development Essential Training

Start my 1-month free trial

Modifying fonts and spacing in SwiftUI

- [Instructor] SwiftUI objects can be modified using attributes. Earlier we look just briefly at an attribute called padding. The reason why I deleted it is so we can have clear code to look at that's easy to read. In order to modify a SwiftUI object's attribute you go after the object in your code, for example on the next line, and then you type a dot and then the attribute that you want to modify. So let's say I wanted to add padding to this object here. I can type padding. And here there are several different types of padding and you can see which ones they are and what they do by reading the description in the code hinting window. For now, let's just use the basic padding with parentheses with nothing inside. And you can see here that it says it pads the object with a system-calculated amount of padding. So with that highlighted, I'm going to press return, and then watch this Text object update. So now Text 1 has…

Contents