https://github.com/ReactiveCocoa/ReactiveCocoa
https://github.com/Alamofire/Alamofire
https://github.com/antitypical/Result
| #!/bin/bash | |
| # | |
| # Updates all plug-ins to be compatible with the latest Xcode and Xcode-beta | |
| # | |
| plugins_location="~/Library/Application\ Support/Developer/Shared/Xcode/Plug-ins" | |
| # Get Xcode's version | |
| current_xcode_version="$(defaults read /Applications/Xcode.app/Contents/Info DVTPlugInCompatibilityUUID)" |
It's now here, in The Programmer's Compendium. The content is the same as before, but being part of the compendium means that it's actively maintained.
| import UIKit | |
| import PlaygroundSupport | |
| public extension UIColor { | |
| public func hsba() -> (hue: CGFloat, saturation: CGFloat, brightness: CGFloat, alpha: CGFloat)? { | |
| var hue: CGFloat = .nan, saturation: CGFloat = .nan, brightness: CGFloat = .nan, alpha: CGFloat = .nan | |
| guard self.getHue(&hue, saturation: &saturation, brightness: &brightness, alpha: &alpha) else { | |
| return nil | |
| } | |
| return (hue: hue, saturation: saturation, brightness: brightness, alpha: alpha) |
| /// A type that has an "empty" representation. | |
| public protocol EmptyRepresentable { | |
| static func empty() -> Self | |
| } | |
| extension Array: EmptyRepresentable { | |
| public static func empty() -> Array<Element> { | |
| return Array() | |
| } | |
| } |