This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// NSView+ChangeAnchorPointWithoutMakingTheLayerJump.swift | |
// | |
// Setting .anchorPoint on a layer makes the layer jump which is most | |
// likely not what you want. This extension fixes that. Useful for Core Animation. | |
// | |
// Usage: (e.g., to set the anchor point to the centre) | |
// | |
// myView.setAnchorPoint(CGPointMake(0.5, 0.5)) | |
// |