I\'m making a little server app for OS X and I\'m using an NSTextView to log some info about connected clients.
Whenever I need to log something I\'m appending the n
Swift 4 + 5
let smartScroll = self.textView.visibleRect.maxY == self.textView.bounds.maxY self.textView.textStorage?.append("new text") if smartScroll{ self.textView.scrollToEndOfDocument(self) }