layer cannot be modified in NSCollectionViewItem

129 views Asked by At

I subclassed an NSCollectionViewItem and want to modify the layer of its view, but I can't get it to work.

override func awakeFromNib() {
    self.view.layerContentsRedrawPolicy = NSViewLayerContentsRedrawPolicy.OnSetNeedsDisplay
    self.view.layer!.backgroundColor = NSColor.whiteColor().CGColor
    self.view.layer!.borderColor = NSColor.blackColor().CGColor
    self.view.layer!.borderWidth = 3
    self.view.updateLayer()
}

I activated core layer animation in IB of every single view in my project, but still no change. How can I make changes to the views layer?

0

There are 0 answers