Skip to content

Instantly share code, notes, and snippets.

@brunophilipe
Created August 7, 2020 15:41
Show Gist options
  • Select an option

  • Save brunophilipe/c1d86fda7fdba90d31457a51a3ae96c6 to your computer and use it in GitHub Desktop.

Select an option

Save brunophilipe/c1d86fda7fdba90d31457a51a3ae96c6 to your computer and use it in GitHub Desktop.

Revisions

  1. brunophilipe created this gist Aug 7, 2020.
    22 changes: 22 additions & 0 deletions NoInsetsTableView.swift
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,22 @@
    //
    // NoInsetsTableView.swift
    // Mastonaut
    //
    // Created by Bruno Philipe on 04.07.20.
    // Copyright © 2020 Bruno Philipe. All rights reserved.
    //
    import Foundation

    class NoInsetsTableView: NSTableView {

    override func awakeFromNib() {
    super.awakeFromNib()

    if #available(OSX 11.0, *), let clipView = enclosingScrollView?.contentView {
    clipView.automaticallyAdjustsContentInsets = false
    clipView.contentInsets.top = -10
    clipView.contentInsets.left = -16
    clipView.contentInsets.right = -16
    }
    }
    }