A simple proof-of-concept SwiftUI application that renders a HTML-like language using SwiftUI Text elements.
Goal of this project is to test the described proof-of-concept. In the moment both the parser and the renderer are fairly
buggy. The language used is closely related to HTML and those comfortable with HTML should also be comfortable with this
language. The string is parsed into an abstract sytnax tree consisting of Tag structs. The tree is then rendered to
SwiftUI native Text views.
- Formatted localized strings
- Loading text from a database
- Allowing the user to format text in a certain way
The following tags are implemented:
largeTitle/h1title/h2headline/h3subheadline/h4bodycallout/h5caption/h6footnotebiubrfont- Attributes:
familysizecolor
familyandsizeattributes both have to be present for them to have any effectcolorcan only be given using hex values i.e.#ff0000and#ff0000aa
- Attributes:
Block elements like h1/h2/h3/h4/h5 are not implemented in the moment. Newlines can only be added using \n and <br/>
The XML-like parser is very rudimentary and does not follow any specs. Unlike in HTML every tag that was opened has to be
closed - this includes <br/>.