Popularity
4.3
Stable
Activity
0.0
Stable
323
10
17

Code Quality Rank: L5
Programming language: Swift
License: MIT License
Tags: Utility    
Latest version: v1.1.0

Scale alternatives and similar libraries

Based on the "Utility" category.
Alternatively, view Scale alternatives based on common mentions on social networks and blogs.

Do you think we are missing an alternative of Scale or a related project?

Add another 'Utility' Library

README

Scale

❤️ Support my app ❤️

❤️❤️😇😍🤘❤️❤️

Unit converter in Swift

CI Status Version License Platform Carthage compatible

[](Screenshots/Banner.png)

Usage

To run the example project, clone the repo, and run pod install from the Example directory first.

Features

Unit

  • Strongly typed unit
  • Division may throw error
  • Operation upon same type, the result is the smaller unit of the two
let length = 5.kilometer + 7.meter  // 5007 meter
let weight = 10.0.kilogram * 5.gram // 50000 gram
  • Convert to any unit of the same type
2.week.to(unit: .hour) // 336 hour

Support

  • Angle

    let angle = 5.degree + 2.radian
    
  • Area

    let area = 5.acre + 2.hectare
    
  • Energy

    let energy = 5.joule + 2.watthour
    
  • Metric

    let metric = 5.base + 2.kilo
    
  • Volume

    let volume = 5.liter + 2.gallon
    
  • Temperature

    let temperature = 5.fahrenheit + 2.celsius
    
  • Time

    let time = 5.day + 2.hour
    
  • Length

    let length = 5.yard + 2.meter
    
  • Weight

    let weight = 5.kilogram + 2.pound
    

Add more

  • Add new definition file with extension .def inside Definitions group
  • Run xcrun swift Script.swift inside Script group
  • Add newly generated files into Output group, target Scale
  • Go into Example and pod install

Notes

Some unit types like Temperature must be converted manually

Installation

Scale is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "Scale"

Author

Khoa Pham, [email protected]

License

Scale is available under the MIT license. See the LICENSE file for more info.


*Note that all licence references and agreements mentioned in the Scale README section above are relevant to that project's source code only.