Swift 用于 iOS 应用程序的扩展。
/// Converts a string into a url
var url: NSURL? { get }
/// The number of Unicode characters in the receiver
var length: Int { get }
/// Is valid email address
var isValidEmail: Bool { get }
/// Meters
var m: Double { get }
/// Kilometers to meters
var km: Double { get }
/// Centimeters to meters
var cm: Double { get }
/// Millimeters to meters
var mm: Double { get }
/// Pounds to meters
var ft: Double { get }
/// Return string url
var string: String { get }
/// Open url in safari
func openWebsiteInSafari() -> Bool
/// Moved object at index to index
func moveObjectAtIndex(index: Int, toIndex: Int) -> Bool
/// Show alert with title
class func showWithTitle(title: String)
/// Show alert with message
class func showWithMessage(message: String)
/// Show alert with title and message
class func showWithTitle(title: String, message: String)
/// Show alert with title, message and cancel button title
class func showWithTitle(title: String?, message: String?, cancelButtonTitle: String)
/// Is retina screen
var isRetina: Bool { get }
/// App build version
var buildVersion: String? { get }
/// App version
var appVersion: String? { get }
/// Returns random color with alpha 1.0
class func randomColor() -> UIColor
/// Returns random color with custom alpha
class func randomColorWithAlpha(alpha: CGFloat) -> UIColor
此代码在 MIT 许可证的条款和条件下分发。