When using SwiftUI with iOS 14, I was unable to find out how to render html markup into actual text. I used SwiftSoup to parse the HTML into a string, but it removed <br/> and it didn't parse it into an NSAttributedString for formatting. Once I inserted my own line break via \n in the attributed string, UIKit removed the formatting for all links after the first line break. Overall, multiple pieces of breaking library code that make for one convoluted mess.
iOS 14+ SwiftUI Rendering TextView DataDetector without WebKit
537 views Asked by Eli017 At
1
There are 1 answers
Related Questions in HTML
- How to store a date/time in sqlite (or something similar to a date)
- How to use custom font during html to pdf conversion?
- Storing the preferred font-size in localStorage
- mp4 embedded videos within github pages website not loading
- Scrimba tutorial was working, suddenly stopped even trying the default
- Is there any way to glow this bulb image like a real light bulb
- With non-graphical maps in Leaflet, zoomDelta doesn't work
- What can I do to improve my coding on both html and css
- Uncaught TypeError: google.maps.LatLng is not a constructor at init (script.js:7:13)
- Bootstrap modal not showing at the desired position on a web page when the screen size is smaller
- Displaying a Movie List on a Website Using Jinja2 and Bootstrap
- How to redirect to thank you page after submitting a Google form embedded into a Google Site?
- Storing selected language in localStorage
- Fences (parenthesis, braces) in HTML and MathML
- Understanding Scroll Anchoring Behavoir
Related Questions in SWIFTUI
- Navigate after logged in with webservice
- When using onDrag in SwiftUI on Mac how can I detect when the dragged object has been released anywhere?
- ScrollView with multiple LazyVGrids jumping around when using .scrollPosition
- How to correct error: "Cannot convert value of type 'MyType.Type' to expected argument type 'Binding<MyType>'"?
- Using @Bindable with a Observable type in SwiftUI
- How to make a scroll view of 9 images in a forEach loop open on image 6 if image 6 is clicked on from a grid?
- Hide LiveActivityIntent Button from Shortcuts App
- Accessibility : Full keyboard access with scroll view in swiftui
- Custom layout occupies all horizontal space
- Detect Tab View drag gesture
- Lazy loading of dependent relationship in SwiftData
- How do a create a reusable simple custom list style with my own color and spacing
- Why/how does a SwiftUI view's identity depend on the value of its `@StateObject` member variable?
- Sheet binded item doesn't deinitialize SwiftUI
- Realm Swift - collection changes listener in SwiftUI
Related Questions in NSATTRIBUTEDSTRING
- Multiline Text Issue with NSAttributedString containing NSTextAttachment
- SwiftUI AttributedString range not deselecting
- Update attributedString in UITextVIew without changing origin attributedString
- How to make an overlay for an image inside HTML text in NSAttributedString using CSS
- NSAttributedString attributes stripped after assigning to NSTextStorage
- HTML tags in UILabel don't work and instead got shown
- When using AsyncDisplayKit / Texture with an NSTextAttachment image in the attributed text of a ASTextNode, how to reload the ASTextNode?
- App crashes when I try to convert HTML string to NSAttributedString - "NSInternalInconsistencyException"
- How to Check If AttributedString isEmpty in SwiftUI
- Is there an option to apply single strikethrough line for NSMutableAttributedString with different fonts?
- iOS: NSAttributedString - writing to data loses adaptive text color
- Why fonts loaded using CoreText (CTFont) behave different than loaded using AppKit (NSFont)?
- How to make attributed string never wrap?
- Why am I seeing different behavior in macOS 14 when creating NSAttributedString from HTML vs doing the same thing with initWithString:attributes:?
- textContainerInset affecting NSAttributedString's background color alignment
Related Questions in IOS14
- Create custom interactive tooltip in swiftUI
- Is it possible to disable the back navigation menu in SwiftUI?
- Set UITableViewCell secondaryText multiple lines
- Orientation issue occurs While Rotate landscape mode to portrait mode In SwiftUI
- Get height of a view inside ZStack in SwiftUI
- How to add Done button to Number Pad keyboard in swiftUI iOS 14
- Resolve: background(alignment:content:) is only available in iOS 15.0 or newer
- How to add axis titles with DGCharts in Swift?
- SwiftUI Interation with Widget on iOS 14
- Is there a way that I can use to create a Dynamic Sheet Height using in SwiftUI (iOS14.7)?
- conflicts with navigation view on SwiftUI
- iOS 13 ObservedObject is not updating the UI while StateObject doing same in iOS 14
- Issue with Combine when migrating to iOS 14
- iOS Universal Linking with Browsers other than Safari
- I can not debug ionic app on macOS ventura. What has changed?
Related Questions in SWIFTSOUP
- Parsing docx with SwiftSoup and SSZipArchive yields unexpected results due to "gramstart" tag
- SwiftSoup Parsing HTML issue
- How do I decode HTML data with Swiftsoup into a struct and print that said struct?
- Get CSS value of a selector in Swift using SwiftSoup
- Swift how can I make this function async to get rid of my application warning
- Can I parse a webpage as a browser would and get back the html DOM element in swiftUI?
- iOS 14+ SwiftUI Rendering TextView DataDetector without WebKit
- Getting all tag elements in an array with SwiftSoup
- SwiftSoup not wrapping body tag
- swift soup parsing with evaluateJavaScript in webview
- Closure containing control flow statement cannot be used with result builder 'ViewBuilder'
- how to save data from webcrawlling by date, mealtype
- Parse <img src> tag under div in to body in HTML using Swift with the help of SwiftSoup
- How to parse html that has the updated DOM? Swift
- url data task is not showing the right content when parsed with SwiftSoup? Swift 5
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Popular Tags
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
I learned that the best thing to do to keep the link formatting of a
TextViewin SwiftUI is done through several steps.UIViewRepresentableforTextView(code down below).<br />with custom string so that it doesn't get erased by SwiftSoup (can't be\n).DataTextView.Implementation:
UIBridge: