{"id":22389591,"url":"https://github.com/floriankrueger/standards","last_synced_at":"2025-07-31T07:32:33.053Z","repository":{"id":62455964,"uuid":"87907668","full_name":"floriankrueger/Standards","owner":"floriankrueger","description":"Backport of Foundations’ Measurements API","archived":false,"fork":false,"pushed_at":"2017-08-24T06:54:49.000Z","size":41,"stargazers_count":9,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"develop","last_synced_at":"2025-07-07T01:07:05.315Z","etag":null,"topics":["carthage","cocoapods","compatibility","ios","macos","measurements","tvos","watchos"],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/floriankrueger.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-04-11T08:11:48.000Z","updated_at":"2023-02-26T21:35:28.000Z","dependencies_parsed_at":"2022-11-02T00:17:23.119Z","dependency_job_id":null,"html_url":"https://github.com/floriankrueger/Standards","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/floriankrueger/Standards","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/floriankrueger%2FStandards","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/floriankrueger%2FStandards/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/floriankrueger%2FStandards/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/floriankrueger%2FStandards/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/floriankrueger","download_url":"https://codeload.github.com/floriankrueger/Standards/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/floriankrueger%2FStandards/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268004214,"owners_count":24179378,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-31T02:00:08.723Z","response_time":66,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["carthage","cocoapods","compatibility","ios","macos","measurements","tvos","watchos"],"created_at":"2024-12-05T03:12:23.095Z","updated_at":"2025-07-31T07:32:32.725Z","avatar_url":"https://github.com/floriankrueger.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![GitHub release](https://img.shields.io/github/release/floriankrueger/Standards.svg)](https://github.com/floriankrueger/Standards)\n[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)\n[![CocoaPods](https://img.shields.io/cocoapods/v/Standards.svg)](https://github.com/floriankrueger/Standards)\n[![Swift](https://img.shields.io/badge/Swift-3.1-orange.svg)](https://swift.org)\n[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/floriankrueger/Standards/master/LICENSE)\n[![Gitmoji](https://img.shields.io/badge/gitmoji-%20😜%20😍-FFDD67.svg?style=flat-square)](https://gitmoji.carloscuesta.me)\n[![HelpWanted](https://img.shields.io/badge/help-wanted-blue.svg?style=flat)](https://github.com/floriankrueger/Standards/issues) \n\n# Standards\n\nStandards was created to enable iOS, tvOS, watchOS and macOS developers that need to support legacy\nsystems (pre iOS 10.0, pre tvOS 10.0, pre watchOS 3.0 and pre macOS 10.12) to use the \n[Measurement](https://developer.apple.com/reference/foundation/Measurement) API that’s included in \nthese systems’s Foundation.\n\n## Compatibility\n\n- [x] iOS 8.0\n- [x] tvOS 9.0\n- [x] watchOS 2.0\n- [x] macOS 10.10\n\n## Features\n\nCompared to [Measurement](https://developer.apple.com/reference/foundation/Measurement), Standards\nhas the following features:\n\n- [x] Creating and Converting Standards (e.g. kilometers to miles)\n- [ ] Calculate with Standards (Operators +, -, \\*, /)\n- [x] Compare Standards\n- [ ] Measurement Formatting\n\nCompared to [Measurement](https://developer.apple.com/reference/foundation/Measurement), Standards \nsupports the following Units:\n\n- [ ] Acceleration: [UnitAcceleration](https://developer.apple.com/reference/foundation/UnitAcceleration)\n- [ ] Angle: [UnitAngle](https://developer.apple.com/reference/foundation/unitangle)\n- [x] Area: [UnitArea](https://developer.apple.com/reference/foundation/unitarea)\n- [ ] ConcentrationMass: [UnitConcentrationMass](https://developer.apple.com/reference/foundation/unitconcentrationmass)\n- [ ] Dispersion: [UnitDispersion](https://developer.apple.com/reference/foundation/unitdispersion)\n- [ ] Duration: [UnitDuration](https://developer.apple.com/reference/foundation/unitduration)\n- [ ] ElectricCharge: [UnitElectricCharge](https://developer.apple.com/reference/foundation/unitelectriccharge)\n- [ ] ElectricCurrent: [UnitElectricCurrent](https://developer.apple.com/reference/foundation/unitelectriccurrent)\n- [ ] ElectricPotentialDifference: [UnitElectricPotentialDifference](https://developer.apple.com/reference/foundation/unitelectricpotentialdifference)\n- [ ] ElectricResistance: [UnitElectricResistance](https://developer.apple.com/reference/foundation/unitelectricresistance)\n- [ ] Energy: [UnitEnergy](https://developer.apple.com/reference/foundation/unitenergy)\n- [ ] Frequency: [UnitFrequency](https://developer.apple.com/reference/foundation/unitfrequency)\n- [ ] FuelEfficiency: [UnitFuelEfficiency](https://developer.apple.com/reference/foundation/unitfuelefficiency)\n- [ ] Illuminance: [UnitIlluminance](https://developer.apple.com/reference/foundation/unitilluminance)\n- [x] Length: [UnitLength](https://developer.apple.com/reference/foundation/unitlength)\n- [ ] Mass: [UnitMass](https://developer.apple.com/reference/foundation/unitmass)\n- [ ] Power: [UnitPower](https://developer.apple.com/reference/foundation/unitpower)\n- [ ] Pressure: [UnitPressure](https://developer.apple.com/reference/foundation/unitpressure)\n- [x] Speed: [UnitSpeed](https://developer.apple.com/reference/foundation/unitspeed) (thx @samritchie)\n- [x] Temperature: [UnitTemperature](https://developer.apple.com/reference/foundation/unittemperature) (thx @samritchie)\n- [ ] Volume: [UnitVolume](https://developer.apple.com/reference/foundation/unitvolume)\n\n## Remarks\n\nStandards is designed to be API-compatible with Foundation _on the call site_. So you can just use \nit like you would use [Measurement](https://developer.apple.com/reference/foundation/Measurement), \nwith _one exception_:\n\nFor compatibility reasons with iOS 10.0+, tvOS 10.0+, watchOS 3.0+ and macOS 10.12+ it’s impractical\nto actually call the class `Measurement` (b/c you then would always have to namespace it). So just \nreplace `Measurement` with `Standard`.\n\n## Basic Usage \n\n```swift\nlet distance = Standard(value: 106.4, unit: UnitLength.kilometers)\n// → 106.4 km\n\nlet distanceInMeters = distance.converted(to: .meters)\n// → 106400 m\nlet distanceInMiles = distance.converted(to: .miles)\n// → 66.1140591795394 mi\nlet distanceInFurlongs = distance.converted(to: .furlongs)\n// → 528.911158832419 fur \n```\n\n## Installation\n\nAs for now, you can use [Carthage](https://github.com/Carthage/Carthage) or \n[CocoaPods](https://cocoapods.org) to install Standards using a dependency manager or do it \nmanually.\n\n### Carthage\n\nTo integrate Standards into your Xcode project using Carthage, specify it in your `Cartfile`:\n\n```ogdl\ngithub \"floriankrueger/Standards\"\n```\n\n### CocoaPods\n\nMake sure your `Podfile` contains all of the following lines.\n\n```ruby\nuse_frameworks!\nplatform :ios, '8.0'\n \npod 'Standards'\n```\n\nThen run `pod install`.\n\n### Manually\n\nTo do it 'by hand' take the following files and add them to your project:\n\n- `Sources/Standard.swift`\n- `Sources/Unit/BasedDimension.swift`\n- `Sources/Unit/Dimension.swift`\n- `Sources/Unit/Unit.swift`\n- `Sources/Conversion/UnitConverter.swift`\n- `Sources/Conversion/UnitConverterLinear.swift`\n\n And any of the Units that you need:\n\n- `Sources/Unit/UnitLength.swift`\n- `Sources/Unit/UnitArea.swift`\n- `Sources/Unit/UnitSpeed.swift`\n- `Sources/Unit/UnitTemperature.swift`\n\n## Contributors\n\nThanks for contributing to this project!\n\n- [Sam Ritchie](https://github.com/samritchie)\n\n## License\n\nStandards is released under the [MIT License](LICENSE.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffloriankrueger%2Fstandards","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffloriankrueger%2Fstandards","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffloriankrueger%2Fstandards/lists"}