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

Change title style using


Change title style using a font modifier:

Code:

struct ContentView: View { var body: some View { Label("Location", systemImage: "pin") .font(.title) } }

Output:

ios output

Tip: You can also customise your font using

Code: Use the following line after initialising the label.

.font(.system(size: 20.0))

There are many way to customise all aspects of the label by splitting the text and the image as follows:

Code:

struct ContentView: View { var body: some View { Label { Text("Location") .foregroundColor(Color.blue) } icon: { Image(systemName: "pin") .foregroundColor(Color.red) } } }

Output:

ios output