Skip to content

Instantly share code, notes, and snippets.

@RodolfoAntonici
Last active December 13, 2017 18:34
Show Gist options
  • Save RodolfoAntonici/fb8a8f4124ada6253eb73a53e29470a9 to your computer and use it in GitHub Desktop.
Save RodolfoAntonici/fb8a8f4124ada6253eb73a53e29470a9 to your computer and use it in GitHub Desktop.
A enum of CABasicAnimation key paths to be really easy to use
//
// Created by Rodolfo Antonici on 13/12/17.
// This software is provided by Rodolfo Antonici on an "AS IS" basis.
//
extension CABasicAnimation {
convenience init(keyPath: KeyPath) {
self.init(keyPath: keyPath.rawValue)
}
enum KeyPath: String {
case anchorPoint = "anchorPoint"
case backgroundColor = "backgroundColor"
case backgroundFilters = "backgroundFilters"
case borderColor = "borderColor"
case borderWidth = "borderWidth"
case bounds = "bounds"
case compositingFilter = "compositingFilter"
case contents = "contents"
case contentsRect = "contentsRect"
case cornerRadius = "cornerRadius"
case doubleSided = "doubleSided"
case filters = "filters"
case frame = "frame"
case hidden = "hidden"
case mask = "mask"
case masksToBounds = "masksToBounds"
case opacity = "opacity"
case position = "position"
case shadowColor = "shadowColor"
case shadowOffset = "shadowOffset"
case shadowOpacity = "shadowOpacity"
case shadowPath = "shadowPath"
case shadowRadius = "shadowRadius"
case sublayers = "sublayers"
case sublayerTransform = "sublayerTransform"
case transform = "transform"
case zPosition = "zPosition"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment