My problem: I am building a MacOS app in Swift 3 and am looking to auto-resize (change font-size) text in a NSTextFieldCell, such that the text is always visible in its container.
I have come across Get NSTextField contents to scale but am not sure how to apply this to Swift 3 within my app. Does anyone have any advice or an explanation (or even link) on how to achieve my goal?
I've made a function that return a NSFont object :
You can use it like that :
Tell me if that works for you