Skip to main content
Filter by
Sorted by
Tagged with
0 votes
0 answers
147 views

I am encountering a runtime error in my iOS application when trying to set an NSAttributedString to a UILabel. The crash message on Firebase Crashlytics is: *** -[__NSDictionaryM setObject:forKey:]: ...
Yılmaz edis's user avatar
1 vote
1 answer
87 views

I have an NSAttributedString with two different font sizes for displaying currency in pennys. I need to apply strikethrough to all strings, but not to break line of strikethrough. How can I draw a ...
main_version_of_me's user avatar
15 votes
1 answer
2k views

Does SwiftUI Text not work with NSTextAttachment? I have this AttributedString: var attributedString: AttributedString { var sampleAttributedString = AttributedString(sampleText) // Apply some ...
Crazed'n'Dazed's user avatar
8 votes
2 answers
4k views

I have a string of text of Arabic and English words, I need to add attribute using NSMutableAttributedString and add paragraph styling with NSMutableParagraphStyle. The problem is paragraph style ...
Mc.Lover's user avatar
  • 5,034
1 vote
0 answers
57 views

i am making status app where all status are being fetched from my Wordpress Website , all working fine but i found some problem when i fetch html content and showing it in cells using UILabel. when i ...
noorapps's user avatar
0 votes
1 answer
172 views

I have created a var with default text attributes for an NSMutableAttributedString: static var textFieldDefaultTextAttributes: [NSAttributedString.Key: Any] = [ .font: UIFont(name: "Impact"...
Mauro P.'s user avatar
  • 165
0 votes
4 answers
1k views

The default behavior for UILabel is that it prevents orphan words to appear solely on a separate line. ie: if word wrapping happen to keep 1 word alone at the last line. iOS will prevent that by ...
hasan's user avatar
  • 24.2k
1 vote
1 answer
1k views

I have introduced a styled NSViewRepresentable text field on to my layout in order to use an attributed Text Editor field. I want to influence the content of this text field through some buttons. I ...
iphaaw's user avatar
  • 7,242
0 votes
0 answers
65 views

I was written to code using NSMutableAttributedString() with UIImage() and String. extension UILabel { func attachImageLabel(string: String, image: UIImage?) { let attachment = ...
Tae Hun Yu's user avatar
0 votes
2 answers
306 views

I have several large PDF docs (70-200, pages each). The PDFs themselves are generated from HTML pages (I can't get the source code of the HTML pages which is why I am working with the PDFs). Anyway, ...
PruitIgoe's user avatar
  • 6,396
0 votes
1 answer
863 views

Hi I have to push a viewController on click of HyperLink. I have NSMutableAttributedString text. that attributed text have two hyperlink examples GoToHomeScreen and aboutUs both are hyperLink on ...
Sanjay Mishra's user avatar
0 votes
0 answers
289 views

I'm using the below extension while adding multiple colors to UILabel text. Results are showing as expected in iOS 13 and above, While came to know that it causes issues in iOS 12.4 as showing default ...
Hardik Buddh's user avatar
1 vote
0 answers
233 views

I am using attributed text string in Swift inside a textview, once I add a link attribute to the textview, whatever user writes after that link attribute it will be still as a link attribute and not a ...
Mousa AminSharifi's user avatar
0 votes
1 answer
251 views

I want to apply a specific font to an NSMutableAttributedString where no .font attribute is applied. How could I achieve that? I tried enumerating the attributes that contain a font and extracting the ...
Bogdan's user avatar
  • 412
2 votes
2 answers
2k views

I need to work with attributed strings (NSMutableAttributedString) in SwiftUI to make a simple rich-text editor, and as you might already know, attributed strings are not natively supported in SwiftUI....
Adam M.'s user avatar
  • 105
1 vote
1 answer
191 views

I try to make an if block by checking if an NSMutableAttributedString font size is smaller/greater than some value. I couldn't find an explanation about this. Code sample is as follows: if textView....
Anthon Santhez's user avatar
1 vote
4 answers
2k views

I have one UILabel which shows strikethrough text (e.g. text). It was working fine till iOS 13. In iOS 14, that strikethrough line is not showing, i.e. instead of 'text', it is coming as 'text'. This ...
Arnab's user avatar
  • 4,394
0 votes
0 answers
452 views

I am dynamically getting an HTML string from Server and parsing it to an Attributed String to show it in my app. Since the string has its own styles, it shows different fonts and sizes, something that ...
Fazle Rabbi Linkon's user avatar
0 votes
1 answer
823 views

I am looking for align Text in NSAttributedString. It should be on same indent(List of string on same Column). Output: I have used below code func setAttributedText() { let ...
Amit's user avatar
  • 675
0 votes
1 answer
415 views

I have a string Ex: Arya said "We must find a solution" yesterday. Here I want to restrict the width of the text in bold ("We must find a solution") to 100, but others must not be ...
KP1's user avatar
  • 69
-1 votes
1 answer
342 views

I'm trying to colour occurrences of a string in a string using the below: let text = "R09/27 R13/51 R22/08 R11/11" let attributed = text.color2(redText: ["R09/27", "R11/11"], orangeText: ["R13/51"]) ...
user avatar
3 votes
1 answer
399 views

According to the following documentation (https://developer.apple.com/documentation/uikit/uisegmentedcontrol/1618570-settitletextattributes) I should be able to add attributes to change how it looks ...
Joseph Astrahan's user avatar
0 votes
1 answer
64 views

Getting this from NSMutableAttributedString using the NSLinkAttributeName attribute. Using a html file for the link name. How to make the text area bigger. -(NSMutableAttributedString *)...
James Bonner's user avatar
0 votes
1 answer
114 views

self.descriptionLbl.text = actionReqdText let labelString = self.descriptionLbl.text as! NSString let contactRange1 = labelString.range(of: actionString1) let contactRange2 = labelString....
RenuR's user avatar
  • 57
6 votes
2 answers
2k views

I have an attributed string as below to be displayed in a label. let someText = NSMutableAttributedString(string: "This is a sample text with") let imageAttachment = NSTextAttachment() ...
Rio's user avatar
  • 83

1
2 3 4 5
8