<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "visionOS: -",
    "watchOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "HealthKit",
  "identifier" : "/documentation/HealthKit/HKUnit/unitDivided(by:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "HealthKit"
    ],
    "preciseIdentifier" : "c:objc(cs)HKUnit(im)unitDividedByUnit:"
  },
  "title" : "unitDivided(by:)"
}
-->

# unitDivided(by:)

Creates a complex unit by dividing the receiving unit by another unit.

```
func unitDivided(by unit: HKUnit) -> HKUnit
```

## Parameters

`unit`

The unit to be divided.

## Return Value

A new, complex unit.

## Discussion

This method creates a new, complex unit by dividing one unit by another. For example, you can create a meters-per-second unit by dividing a meters unit by a seconds unit, as shown below.

```objc
HKUnit *meters = [HKUnit meterUnit];
HKUnit *seconds = [HKUnit secondUnit];
HKUnit *metersPerSecond = [meters unitDividedByUnit:seconds];
```

## See Also

[`+  unitFromString:`](/documentation/HealthKit/HKUnit/init(from:)-9qont)

Returns the unit instance described by the provided string.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)