Skip to content

Instantly share code, notes, and snippets.

@anirudhamahale
Last active July 19, 2017 04:32
Show Gist options
  • Save anirudhamahale/0449a589d1379d8dbcb2b18a295c1784 to your computer and use it in GitHub Desktop.
Save anirudhamahale/0449a589d1379d8dbcb2b18a295c1784 to your computer and use it in GitHub Desktop.
Useful extensions
import CoreGraphics
extension CGFloat {
func toRadians() -> CGFloat {
return self * CGFloat.pi / 180
}
func toDegress() -> CGFloat {
return self * 180 / CGFloat.pi
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment