sizeToFit()
Resizes the receiver’s frame so that it’s the minimum size needed to contain its cell.
Declaration
func sizeToFit()Discussion
If you want a multiple-cell custom subclass of NSControl to size itself to fit its cells, you must override this method. This method neither redisplays the receiver nor marks it as needing display. You must do this yourself with either thedisplay() or setNeedsDisplay() method.