TestsTested | ✓ |
LangLanguage | SwiftSwift |
License | MIT |
ReleasedLast Release | Nov 2016 |
SwiftSwift Version | 3.0 |
SPMSupports SPM | ✗ |
Maintained by Khoa Pham.
Unit converter in Swift
To run the example project, clone the repo, and run pod install
from the Example directory first.
let length = 5.kilometer + 7.meter // 5007 meter
let weight = 10.0.kilogram * 5.gram // 50000 gram
2.week.to(unit: .hour) // 336 hour
let angle = 5.degree + 2.radian
let area = 5.acre + 2.hectare
let energy = 5.joule + 2.watthour
let metric = 5.base + 2.kilo
let volume = 5.liter + 2.gallon
let temperature = 5.fahrenheit + 2.celsius
let time = 5.day + 2.hour
let length = 5.yard + 2.meter
let weight = 5.kilogram + 2.pound
.def
inside Definitions
groupxcrun swift Script.swift
inside Script
groupOutput
group, target ScaleExample
and pod install
Some unit types like Temperature
must be converted manually
Scale is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "Scale"
Khoa Pham, [email protected]
Scale is available under the MIT license. See the LICENSE file for more info.