Swift Spaceship Operator

MIT License
Swift
macOS

1 image

Author

NSPostWhenIdle

Description

Contains a Swift file to add the spaceship operator ( <=> ) to a project

6.0 <=> 17.0 // Outputs -1

9001.0 <=> 9000.0 // Outputs 1

4.0 <=> 4.0 // Outputs 0

Works on iOS and OS X but the Xcode project is set up as an OS X command line tool.

Tags