Swifterswift: Feature Request : NSView extension

Created on 4 Aug 2018  路  2Comments  路  Source: SwifterSwift/SwifterSwift

Can you please add below:

@IBDesignable
extension NSView
{
    @IBInspectable var backgroundColor: NSColor? {
        get {
            if let colorRef = self.layer?.backgroundColor {
                return NSColor(CGColor: colorRef)
            } else {
                return nil
            }
        }
        set {
            self.wantsLayer = true
            self.layer?.backgroundColor = newValue?.CGColor
        }
    }
}
enhancement feature request good first issue help wanted

Most helpful comment

You鈥檙e welcome to open a pull request yourself and do it 馃檪

All 2 comments

You鈥檙e welcome to open a pull request yourself and do it 馃檪

Created first pull request, hope someone will approve and merge to master.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

LucianoPAlmeida picture LucianoPAlmeida  路  4Comments

pawurb picture pawurb  路  3Comments

omaralbeik picture omaralbeik  路  3Comments

omaralbeik picture omaralbeik  路  3Comments

omaralbeik picture omaralbeik  路  3Comments