NSScreencast Episode #127 Swift Operators
Swift Operators - NSScreencast
SwiftでOperatorを定義 =~
- be guard
- init
- The Swift Programming Language: Initialization
- initとfuncで引数の扱いが違う
- external first argument
- struct Celsius
- init(fromFahrenheit fahrenheit: Double)
- Celsius(fromFahrenheit: 212.0)
- init(fromKelvin kelvin: Double)
- Celsius(fromKelvin: 273.15)
- init(fromFahrenheit fahrenheit: Double)
- struct Celsius
- 暗黙の引数
- class Regex
- func test(input: String) -> Bool {
- let range = input.rangeOfString(pattern, options: .RegularExpressionSearch)
- return range.getLogicValue()
- func test(input: String) -> Bool {
- operator infix =~ {}
- func =~(input: String, pattern: String) -> Bool {
- return Regex(pattern).test(input)
- if input =~ "^\d+$" {
- func =~(input: String, pattern: String) -> Bool {
- operator infix .. {}
=~
equal squiggle- squiggle 短い不規則な曲線,くねった線
- The Swift Programming Language: Advanced Operators