SRML | Slime Rancher Mod Loader for Slime Rancher | Architecture library
kandi X-RAY | SRML Summary
kandi X-RAY | SRML Summary
Slime Rancher Mod Loader for Slime Rancher
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of SRML
SRML Key Features
SRML Examples and Code Snippets
Community Discussions
Trending Discussions on SRML
QUESTION
In my app I need to visually style and highlight long texts that come from a DB. The texts are written as following:
Accept the current situation and then try to build a better one on top of it. Only then will you catch a break from all that getting away and will be able to think about how to actually improve.
Resistance deepens the negative thoughts, acceptance releases them.
On Android, I take these texts and parse them using Regex to replace the tags with something that works with the library. I'm using the SRML library to display it like this:
iOSNow my question is: how do I reach a somewhat similar experience on iOS?
I'm using SwiftUI so far, but I can see that it's pretty limited in this specific regard. All I've found so far are libraries that helps you make it bold, italic or something other very minor:
But I specifically need to highlight phrases, meaning color their background yellow. I then found this library, that offers some pretty complex functionality, but is written in Objective-C and I don't know how well that will work with my SwiftUI basis: https://github.com/ibireme/YYText
Is there any chance for me to get it working with SwiftUI components?
My best guess would be to do something like this (very basic pseudo code):
...ANSWER
Answered 2021-Nov-07 at 11:15With the help of a freelancer on Fiverr I solved it in the following way:
https://stackoverflow.com/a/69871902/1972372
Basically parsed the tags manually and kept track of the content types and order in an array, while keeping formatted Texts
in another array. Then I could take that content and plant it into a ViewBuilder
body function.
Unfortunately, SwiftUI doesn't let you change a Text
's background color yet, without turning it into some View
. So I had to make do with other, similar formattings for now.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install SRML
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page