Skip to main content
Filter by
Sorted by
Tagged with
1 vote
2 answers
85 views

The different coordinate systems of Cocoa and UIKit cause problem when drawing a string in a UIGraphicsContext. I have written code for macOS, where I draw a combination of primitives, attributedText, ...
MassMover's user avatar
  • 577
0 votes
2 answers
125 views

I want to implement a UITextView whose content consists of plain text and tags, where the tags are text with a rounded gray background. I tried to use NSAttributedString, but it cannot set rounded ...
user1605810's user avatar
2 votes
1 answer
148 views

I completely stuck with subclass NSTextAttachmentViewProvider in swift 6 concurrency. So lets say I have a simple custom NSTextAttachmentViewProvider: final shapeViewProvider: ...
rckoenes's user avatar
  • 69.5k
6 votes
3 answers
1k views

I'm upgrading my project to Xcode 16. When using the following function, it renders correctly with Xcode 15 but it is not on Xcode 16. // The label created with `attributedText`. let label = UILabel() ...
user3297288's user avatar
1 vote
1 answer
138 views

We have previously solved similar issues like: SwiftUI tappable subtext But how do you make subtext tappable, and also pop a dropdown at it's location when tapped? Do we need to use a webview? Split ...
randomor's user avatar
  • 5,745
1 vote
0 answers
97 views

Im working on an IOS app using swift and facing an issue with NSAttributedString where im trying to apply a hyperlink to a substring of a text. The hyperlink is functional but the link color remains ...
PlatyPlayer's user avatar
1 vote
1 answer
107 views

I'm trying to parse html text that contains a youtube video. To display this video I use a preview image. Initial text: <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod ...
Astro's user avatar
  • 11
0 votes
1 answer
47 views

I've got this HTML text: "<style>* {font-size: 12pt !important;color: #000000 !important;font-family: Montserrat-Regular !important;}</style>Perform the following steps:<br><...
Bawenang Rukmoko Pardian Putra's user avatar
0 votes
0 answers
171 views

App crashes when I try to convert HTML string to NSAttributedString and assign it to a textView. @IBOutlet weak var standingBillerNoteTextView: UITextView! self.standingBillerNoteTextView....
Gaurav Bisht'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
0 votes
0 answers
89 views

I tried to load font using CTFontCreateWithFontDescriptor() and it behaves differently than loaded using NSFont(). Let's say the goal is to load font using CoreText that is exactly the same as using ...
Marcel Kiss's user avatar
0 votes
1 answer
111 views

I let my user choose a font from their installed fonts, then use that font in three different contexts in my macOS app. The list of fonts itself uses NSFontDescriptor to create an attributed string, ...
Craig's user avatar
  • 3,317
1 vote
1 answer
87 views

I have a SwiftUI Texteditor and whenever I press the update button the color should be applied to the text however it just gets reseted to initialValue. Can anyone help me? import SwiftUI class ...
Karl Ehrlich's user avatar
0 votes
0 answers
112 views

I have these extensions to parse string with html tags to NSAttributedString extension StringProtocol { var html2AttributedString: NSAttributedString? { Data(utf8).html2AttributedString ...
Roman Markov's user avatar
2 votes
1 answer
618 views

I am attempting to make something that would make it possible to add custom UIView subclasses as attachments in UITextView. As of iOS 15, there appears to be an API that allows you to register custom &...
martega's user avatar
  • 2,183
-1 votes
3 answers
92 views

I have a string value containing an amount, where I specified the decimal part as after "," and I want to change the font of the part after "," to be half of the other part private ...
HBK's user avatar
  • 15
0 votes
0 answers
43 views

I have an NSLayoutManager subclass, overriding - (void)drawGlyphsForGlyphRange:(NSRange)glyphsToShow atPoint:(CGPoint)origin and i'm trying to draw the NSAttributedString with CoreText. This is what i ...
SirRupertIII's user avatar
  • 12.6k
1 vote
0 answers
215 views

In an attempt to expose the capabilities of NSAttributedString in combination with UITextView to the world of SwiftUI (specifically the ability to render basic HTML), I've wrapped UITextView in a ...
thomsmed's user avatar
  • 161
2 votes
0 answers
874 views

I'm using the MarkdownUI library and through it I can create a markdown rendering as follows: let someText = " # Title ## Description ## Tables | Left columns | Right columns | | -------------...
Maykon Meneghel's user avatar
1 vote
1 answer
174 views

I am currently developing a Notifications list screen that would display 4 types of notifications. Here is how it would look like in a very simple way: The main problem for me is to make the text ...
Stefan's user avatar
  • 35
0 votes
1 answer
1k views

I have a FAQ page with cells that have a title as a String and a description as an AttributedString so that I can customize the appearance of the link in description. How can I open a link in an app ...
Anna's user avatar
  • 43
1 vote
2 answers
870 views

I have posts on my app where users can tag other users, the expectation is that these tags should be tappable and trigger a function when tapped. For example the post: "hello @someUser and @...
Noah Iarrobino's user avatar
0 votes
1 answer
1k views

I'm trying to create a view in my app that displays a chunk of text. I want certain words within that text to be a clickable link that opens up another view. I've been googling for a long time and can'...
mzm0227's user avatar
  • 65
0 votes
0 answers
69 views

When setting the .ligature attribute on an NSTextView, it gets overridden when adding both a .paragraphStyle and .baselineOffset attribute at the same time. Here's the example, adding the below code ...
thecoolwinter'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

1
2 3 4 5
46