1

Wondering what the correct way is to add non-editable text to an NSView for MacOS using Swift. I am not sure if I am supposed to draw it like this, or if there is another way. I am used to HTML where you just set the textContent property on an element/view and that's it. Not sure if it should be at the level of the canvas/cgrect or UITextView or what.

Basically I would like to add both button labels (small amounts of text) and paragraphs of text (large amounts) using the same approach if possible, using something that has good performance.

Lance
  • 75,200
  • 93
  • 289
  • 503
  • There isn't a one size fits all correct way. Is this an app using a storyboard? Did you try using standard controls like `NSButton` and `NSTextView`? – Willeke Aug 08 '18 at 11:52
  • No this isn't using storyboard. I could try NSTextView, but I'm just not sure if that's too "heavyweight" – Lance Aug 08 '18 at 11:54
  • `NSTextField` is simpler. – Willeke Aug 08 '18 at 12:05

0 Answers0