From the course: Programming for Non-programmers: iOS 17 and Swift 5

Unlock this course with a free trial

Join today to access over 23,400 courses taught by industry experts.

Replacing the mode buttons with symbols

Replacing the mode buttons with symbols

"

- [Presenter] Now let's take a look at taking these buttons over on the right and swapping them out for symbols so we can use images inside of our buttons. What we're basically going to do is copy our CalculatorButton and we'll call it CalculatorImageButton, and in there, we're just going to accept an image instead of text. So let's press command+N on the keyboard, I'll create a new Swift UI view by pressing return because it's already selected, and we'll call this CalculatorImageButton just like that. Hit return or create and there it is. I'm going to go over to CalculatorButton and I'm going to copy everything inside of the view. So line 11 through 27, I'm going to copy that. Go over to CalculatorImageButton, and then I'm going to paste it in. For the action on line 14, I'll need to change that to "CalculatorImageButton". And then I'm going to replace "text" with "image", and just before buttonText, I'm going to type "systemName", and then a colon just like that, and then change the…

Inhalt