Comments (3)
Hi,
Yes, you ar right, It now assumes you are doing everything on the main.
I think that for now you could use a workaround like this:
DispatchQueue.global().async {
let at: NSMutableAttributedString = "red".red.attributedText
DispatchQueue.main.async {
self.myLabel.attributedText = at
}
}
I will think about how to embed functionality like this into the library.
from attributedtextview.
A bit late to the party, but don't perform this inside your cell on a background thread unless you are also willing to handle canceling the background task when the cell is dequeued and reused. The better solution would be to have this work done in the UITableViewDatasource so you can process it and then set it on the cell at the proper indexPath if that cell is still being viewed.
from attributedtextview.
@jameshays Good point. I was already hesitating implementing it the way I suggested.
from attributedtextview.
Related Issues (20)
- Problem with custom hyperlinks inside the brackets HOT 2
- AttributedTextView's append(_:) method in String+Attributer.swift conflicts with Swift's append(_:) HOT 1
- fixed
- Can this work in iOS 9? HOT 6
- WARN | xcodebuild HOT 3
- Setting of attributer changes selectable and editable HOT 4
- The example does not run and complains about image not found ? HOT 1
- Disable selection for textView HOT 4
- Error when compiling in xcode 10 swift 4.2 HOT 2
- How to match https HOT 1
- UITextViewDelegate should return values based on isEditable HOT 2
- How can I change truncation text when textview clip? HOT 3
- Default font changes in Xcode 11 HOT 3
- Update padding between underline and text HOT 1
- <a href> </a> Anchor tags are not clickable (only detected as html link) HOT 2
- Using Swift Package Manager HOT 3
- i have one tableview in that i have lots of different arabic word in every tableview cell. i want position of clicked text. because i want to open popup at particulate text click with particulate text own content like translation.how can i can get absolute position of clicked text?
- Tag for latest version HOT 1
- Match hashtag with emoji iOS 16 HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from attributedtextview.