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

Customising Labels


Customising Labels

Labels can be customised using the labelStyle() modifier.

To display only titles use

Code:

import SwiftUI struct ContentView: View { var body: some View { Label("Location", systemImage: "pin") .labelStyle(IconOnlyLabelStyle()) } } struct ContentView_Previews: PreviewProvider { static var previews: some View { ContentView() } }

Output:

ios output

To display only images use

Code:

import SwiftUI struct ContentView: View { var body: some View { Label("Location", systemImage: "pin") .labelStyle(TitleOnlyLabelStyle()) } } struct ContentView_Previews: PreviewProvider { static var previews: some View { ContentView() } }

Output:

ios output