Tuesday, April 21, 2026
HomeiOS Developmentios - AWS Amplify string textual content markdown in Swift not displaying

ios – AWS Amplify string textual content markdown in Swift not displaying

[ad_1]

I’ve seen different questions on right here asking about textual content markdown not displaying in Swift however nothing immediately associated to AWS Amplify. I’ve tried the options such because the one linked under however nothing has labored up to now.

SwiftUI Textual content Markdown dynamic string not working

I am utilizing AWS Amplify to ship information articles to my app and the textual content physique of the article is formatted as an optionally available string. Right here is how it’s setup in my Mannequin:

public struct Article: Mannequin {
public var physique: String?

I’ve tried utilizing

Textual content(.init(article.physique ?? "Physique"))

and

Textual content(attempt! AttributedString(markdown: article.physique ?? "Physique"))

However every methodology would not appear to work. Under is a snippet of the textual content physique that I am making an attempt to have show new strains.

The Cubs defeated the Reds 4-2 within the second-ever Discipline of Goals MLB recreation in Iowa, and each groups relished the expertise.nnThe Cubs received MLB’s 2022 Discipline of Goals recreation over the Reds 4-2. Here’s a have a look at one of the best moments from Thursday’s motion.

Earlier than integrating AWS Amplify I used to be testing with native JSON recordsdata that I used to be loading into my app and the formatting was displaying correctly.

What am I lacking and/or not understanding?

[ad_2]

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments