TestsTested | ✓ |
LangLanguage | SwiftSwift |
License | MIT |
ReleasedLast Release | Dec 2017 |
SPMSupports SPM | ✗ |
Maintained by Tomas Friml.
Provides additional operators currently not supported in Swift:
Conjuncition:
true ∧ false
(U+2227)
true && false
and(true, false)
Disjunction:
true ∨ false
(U+2228)
true || false
or(true, false)
Negation (NOT):
¬true
(U+00AC)
~true
not(true)
Implication (IMPL):
false ⇒ true
(U+21D2)
false → true
(U+2192)
false ⊃ true
(U+2283)
impl(false, true)
Exclusive disjunction (XOR):
true ⊕ false
(U+2295)
true ⊻ false
(U+22BB)
true ^^ false
Equality (XNOR)
true ⇔ false
(U+21D4)
true ≡ false
(U+2261)
true ↔ false
(U+2194)
xor(true, false)
Negated conjunction (NAND)
true ↑ false
(U+2191)
true ⊼ false
(U+22BC)
nand(true, false)
Negated disjunction (NOR)
true ↓ false
(U+2193)
true ⊽ false
(U+22BD)
nor(true, false)
You can use the same operators as in Logical operators section above.
var left = true
Conjunction AND (&&=
, &=
, ∧=
)
left &&= false
, left
equals false
Disjunction OR (||=
, |=
, ∨=
)
left ||= false
, left
equals true
Implication IMPL (→=
, ⇒=
, ⊃=
)
left →= false
, left
equals false
Exclusive disjunction XOR (^^=
, ^=
, ⊕=
, ⊻=
)
left ^^= true
, left
equals false
Equality XNOR (⇔=
, ≡=
, ↔=
)
left ⇔= true
, left
equals true
Negated conjunction NAND (↑=
, ⊼=
)
left ↑= true
, left
equals false
Negated disjunction NOR (↓=
, ⊽=
)
left ↓= false
, left
equals false
To run the example project, clone the repo, and run pod install
from the Example directory first.
iOS 8+
OperatorExtensions is available through CocoaPods. To install
it, simply add the following line to your Podfile:
pod "OperatorExtensions"
Tomas Friml, [email protected]
OperatorExtensions is available under the MIT license. See the LICENSE file for more info.