lionhylra / NSTextView-LineNumberView

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

Repository from Github https://github.comlionhylra/NSTextView-LineNumberViewRepository from Github https://github.comlionhylra/NSTextView-LineNumberView

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()
    }
}

About

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

License:MIT License


Languages

Language:Swift 100.0%