IOS TOPICS

IOS Introduction
Swift UI Label
Swift UI Button
Swift UI Text Field
Swift UI Slider
Swift UI Switch
Swift UI Stepper
Swift UI Date Picker
Swift UI Segmented Control
Views
Table View
Collection Views
SCROLL VIEW
iOS Content View
iOS View Controllers
iOS Bar interface
iOS Navigation interface
iOS Architect Pattern
iOS Libraries
iOS Web request and parsing
iOS user defaults
iOS Coredata and database

Creating Button with Images


Creating Button with Images:

To create a button that’s an image we use an Image control instead of Text as shown below.

Note: The image you want to use should be uploaded to the assets folder on Xcode

ios output

Going ahead, we can use this image as a button if we reference the image name and with an Image control replacing the Text control.

Code:

ios output

Output:

ios output

Just as we saw with the Text control, we can modify and customize our image as follows

Code:

ios output

Output:

ios output

Finally putting together everything we’ve learned so farCreating a button with text, image and borders using a horizontal stack-

Code:

ios output

Output:

ios output