Visit my blog or connect with me on Twitter
git init
or
| #!/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)" |
Visit my blog or connect with me on Twitter
git init
or
A type is a collection of possible values. An integer can have values 0, 1, 2, 3, etc.; a boolean can have values true and false. We can imagine any type we like: for example, a HighFive type that allows the values "hi" or 5, but nothing else. It's not a string and it's not an integer; it's its own, separate type.
Statically typed languages constrain variables' types: the programming language might know, for example, that x is an Integer.
In that case, the programmer isn't allowed to say x = true; that would be an invalid program.
The compiler will refuse to compile it, so we can't even run it.
| 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) |