0

I am pulling down text from firebase and in one of the strings is a bulleted list e.g:

"""

The second part of the thesis will consist of;

  • Building life span and flexibility requirements
  • Project expectations

The design brief will research and analyse how existing buildings are built for cold climates and digital nomadic living by looking at numerous categories;

"""

Im trying to figure out what the best way to deal with this is.

Is it possible to use Attributed text and a swiftUI Text view.

Is the only way to do this using a WKWebView and update the string to be in HTML with all the HTML markdown added etc.

Wazza
  • 1,725
  • 2
  • 17
  • 49
  • This question is slightly unclear - is your question how you can make a bulleted list in SwiftUI from a list in firebase? –  May 04 '22 at 17:41
  • Its a question of whats the best route, from what i can see it looks like WKWebview and then make the text in firebase formatted in HTML – Wazza May 04 '22 at 17:46
  • Yes, I would agree with that. SwiftUI can display text in markdown if you wanted to try to format your text so it can be displayed in that way too. –  May 04 '22 at 17:53
  • From what i can see it doesnt recognise the markdown for bullet points, but maybe i set it up worng – Wazza May 04 '22 at 17:58
  • 1
    Then you could try, instead of a `Text`, an `AttributedString` as you suggested above. https://stackoverflow.com/questions/59531122/how-to-use-attributed-string-in-swiftui –  May 04 '22 at 18:06
  • This might help too. https://swiftui-lab.com/attributed-strings-with-swiftui/ https://developer.apple.com/documentation/foundation/attributedstring/ –  May 04 '22 at 18:07
  • AttributedString markdown doesnt seem to recognise bullet points which is annoying – Wazza May 05 '22 at 09:02
  • In that case, I would go with your original WebView idea. –  May 05 '22 at 13:20
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/244514/discussion-between-mr-developer-and-wazza). –  May 05 '22 at 15:55

0 Answers0