I have searched extensively and cannot for the life of me find any information about how to achieve a similar effect to that of the iTunes song title scrolling if the text is too large in Cocoa. I have tried setting the bounds on a NSTextField to no avail. I have tried using NSTextView as well as various attempts at using NSScrollView. I am sure I am missing something simple but any help would be greatly appreciated. I am also hoping to not have to use CoreGraphics if at all possible.
Example, notice the "Base.FM http://www." text has been scrolled. If you need a better example open iTunes with a song with a rather large title and watch it scroll back and forth.
I would think surely there is a simple way to just create a marquee type effect with an NSTextField and an NSTimer, but alas.
For anyone looking for this in Swift 4, I have converted Dave's answer and added some more functionality.
Reference gist: https://gist.github.com/NicholasBellucci/b5e9d31c47f335c36aa043f5f39eedb2
I can see how this would be difficult if you're trying to shoehorn the functionality into an exist control. However, if you just start with a plain NSView, it's not that bad. I whipped this up in about 10 minutes...
Just drag an NSView onto your window in Interface Builder and change its class to "ScrollingTextView". Then (in code), you do:
This is obviously pretty rudimentary, but it does the wrap around stuff that you're looking for and is a decent place to start.