<!--
{
  "availability" : [
    "watchOS: 2.0.0 - 3.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "HealthKit",
  "identifier" : "/documentation/HealthKit/HKWorkoutSession/init(activityType:locationType:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "HealthKit"
    ],
    "preciseIdentifier" : "c:objc(cs)HKWorkoutSession(im)initWithActivityType:locationType:"
  },
  "title" : "init(activityType:locationType:)"
}
-->

# init(activityType:locationType:)

Returns a newly instantiated workout session.

```
init(activityType: HKWorkoutActivityType, locationType: HKWorkoutSessionLocationType)
```

## Parameters

`activityType`

The type of activity being performed in the workout. For a list of possible activities, see [`HKWorkoutActivityType`](/documentation/HealthKit/HKWorkoutActivityType).

`locationType`

A value indicating whether the workout was performed indoors or outdoors. For a list of possible location values, see [`HKWorkoutSessionLocationType`](/documentation/HealthKit/HKWorkoutSessionLocationType).

## Return Value

A newly initialized workout session object for the specified activity type and location.

## Discussion

HealthKit uses the session’s workout activity and location type to fine tune Apple Watch’s sensors for the selected activity. All workout sessions generate higher-frequency heart rate samples; however, an outdoor cycling activity generates more accurate location data, while an indoor cycling activity does not.

---

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)