Added center property to CGFloat

This commit is contained in:
Goktug Yilmaz 2015-12-06 22:22:28 -08:00 committed by Goktug Yilmaz
parent d3f027ef6b
commit ce3cfdbfdc
1 changed files with 8 additions and 0 deletions

View File

@ -8,7 +8,15 @@
import UIKit
extension CGFloat {
/// EZSwiftExtensions
public var center: CGFloat { return (self / 2) }
}
/// EZSwiftExtensions
public func degreesToRadians (angle: CGFloat) -> CGFloat {
return (CGFloat (M_PI) * angle) / 180.0
}