/NSTextView-LineNumberView

Add line numbers to an instance of NSTextView. The line number view is implemented as a subclass of NSRulerView.

Primary LanguageSwiftMIT LicenseMIT

NSTextView+LineNumberView

Add line numbers to an instance of NSTextView.

Screenshot

Example

import Cocoa

// Your view controller
class ViewController: NSViewController {

    // The text view you wish to add line number view to
    @IBOutlet var mainTextView: NSTextView!
    
    override func viewDidLoad() {
        super.viewDidLoad()

        mainTextView.lnv_setUpLineNumberView()
    }
}