Counting lines of text in NSTextView
Not as trivial as one might think.
Tags: swift, nstextview, appkit, mac