A precise unit conversion library for Swift providing physical quantity units and simplified manipulation.
MKUnits is a unit conversion library for Swift that provides units of measurement for physical quantities like mass, length, and temperature. It simplifies manipulating these units with precise conversions and arithmetic operations, solving the problem of handling unit conversions accurately in Swift applications.
Swift developers building iOS, macOS, or other Apple platform applications that require reliable unit conversions, such as in fitness, engineering, or scientific apps.
Developers choose MKUnits for its precision with Decimal-based arithmetic, support for common physical units, and easy extensibility to add custom units, making it a robust alternative to manual conversion logic.
Unit conversion library for Swift.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Uses Decimal type for calculations, ensuring high accuracy in conversions, which is highlighted in the example showing exact kilogram to pound conversions without floating-point errors.
Allows easy addition of new unit groups or units via straightforward extensions, as demonstrated in the README with code snippets for creating custom units.
Units are marked with @unchecked Sendable, enabling safe use in concurrent Swift code without extra boilerplate, as noted in the key features.
Supports common physical quantities like mass, length, and temperature out of the box, covering needs for fitness, engineering, and weather apps.
Decimal-based arithmetic, while precise, can be slower than using Double or Float, making it less ideal for apps with frequent, real-time unit conversions.
Only includes a fixed set of unit groups; for specialized domains like electromagnetism or chemistry, developers must manually extend the library, adding complexity.
The README provides basic examples but lacks detailed guides on error handling, complex arithmetic, or integration with UI frameworks, which could slow down adoption.