Tuesday, June 30, 2026
HomeiOS Developmentios - The best way to show strings precisely as is in...

ios – The best way to show strings precisely as is in Textual content views with none particular formatting in SwiftUI?

[ad_1]

I am attempting to show my app’s model and construct quantity in X.X.X (X) format however SwiftUI is routinely formatting the construct quantity right into a circle. How do I cease this habits? I’ve tried a couple of string literal strategies, however nothing has labored up to now.

Screenshot

func versionTextView() -> some View { 
    let appVersion = Bundle.primary.object(forInfoDictionaryKey: "CFBundleShortVersionString") as! String
    let buildNumber = Bundle.primary.object(forInfoDictionaryKey: "CFBundleVersion") as! String
    let versionText = "Model (appVersion) ((buildNumber))"

    // I've additionally tried this
    // let versionText = #"Model #(appVersion) (#(buildNumber))"#

    return Textual content(versionText)
}

[ad_2]

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments