Home SwiftUI Understand Text View In SwiftUI FrameWork

Understand Text View In SwiftUI FrameWork

by reevescode
5,107 views

What is text view ?

SwiftUI Text is a view that is used to display one or more lines of text in Framework.

The Text view displayed is read only.

How to use Text View in SwiftUI Framework ?

Create Text View from a String

– Text(String) : This initializer creates a text view with the text defined by the argument.

– Example:

Text(“This is argument String”)

Create Text View from a Date

– Text(Date,style.DateStyle): This initializer create a Text View to present a date. The first argument defines the date. and the seccond argument is structure that determines the format. The structure include the type properties date as offset, relative, time and timer to define this value.

– Example:

5/5 - (2 votes)

You may also like