View in English

  • Apple Developer
    • 시작하기

    시작하기 탐색

    • 개요
    • 알아보기
    • Apple Developer Program

    알림 받기

    • 최신 뉴스
    • Hello Developer
    • 플랫폼

    플랫폼 탐색

    • Apple 플랫폼
    • iOS
    • iPadOS
    • macOS
    • tvOS
    • visionOS
    • watchOS
    • App Store

    피처링

    • 디자인
    • 배포
    • 게임
    • 액세서리
    • 웹
    • 홈
    • CarPlay
    • 기술

    기술 탐색

    • 개요
    • Xcode
    • Swift
    • SwiftUI

    피처링

    • 손쉬운 사용
    • 앱 인텐트
    • Apple Intelligence
    • 게임
    • 머신 러닝 및 AI
    • 보안
    • Xcode Cloud
    • 커뮤니티

    커뮤니티 탐색

    • 개요
    • Apple과의 만남 이벤트
    • 커뮤니티 주도 이벤트
    • 개발자 포럼
    • 오픈 소스

    피처링

    • WWDC
    • Swift Student Challenge
    • 개발자 이야기
    • App Store 어워드
    • Apple 디자인 어워드
    • 문서

    문서 탐색

    • 문서 라이브러리
    • 기술 개요
    • 샘플 코드
    • 휴먼 인터페이스 가이드라인
    • 비디오

    릴리즈 노트

    • 피처링 업데이트
    • iOS
    • iPadOS
    • macOS
    • watchOS
    • visionOS
    • tvOS
    • Xcode
    • 다운로드

    다운로드 탐색

    • 모든 다운로드
    • 운영 체제
    • 애플리케이션
    • 디자인 리소스

    피처링

    • Xcode
    • TestFlight
    • 서체
    • SF Symbols
    • Icon Composer
    • 지원

    지원 탐색

    • 개요
    • 도움말
    • 개발자 포럼
    • 피드백 지원
    • 문의하기

    피처링

    • 계정 도움말
    • 앱 심사 지침
    • App Store Connect 도움말
    • 새로 추가될 요구 사항
    • 계약 및 지침
    • 시스템 상태
  • 빠른 링크

    • 이벤트
    • 뉴스
    • 포럼
    • 샘플 코드
    • 비디오
 

비디오

메뉴 열기 메뉴 닫기
  • 컬렉션
  • 전체 비디오
  • 소개

더 많은 비디오

  • 소개
  • 요약
  • 코드
  • HealthKit 운동 영역을 사용해 운동 인사이트 제공하기

    HealthKit을 사용하면 앱에서 심박수 및 사이클링 파워 영역과 같은 운동 인사이트를 더 쉽게 제공할 수 있습니다. 내장된 맞춤형 영역을 활용하거나 맞춤형 영역을 생성하는 방법을 알아보세요. 현재 운동 영역과 각 영역에서의 소요 시간을 사용하여 운동 중 및 운동 후에 의미 있는 지침을 제공하는 방법을 살펴보세요.

    챕터

    • 0:01 - Introduction
    • 2:17 - Accessing workout zones
    • 6:19 - Live zone updates
    • 8:11 - Preferred zones
    • 9:00 - Custom zones

    리소스

    • Tracking heart rate zones for workouts
    • Accessing workout zone data
      • HD 비디오
      • SD 비디오
  • 비디오 검색…
    • 3:54 - Reading Heart Rate Zones from a completed workout

      // Read heart rate zones from the completed workout​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​
      
      if let heartRateZoneGroup = workout.zoneGroupsByType?[HKQuantityType(.heartRate)] {​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​
      let zones = ZoneDisplayData(​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​
          zoneCount: heartRateZoneGroup.configuration.zones.count,​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​
          currentZoneIndex: nil,​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​
          durations: heartRateZoneGroup.zoneDurations.map(\.duration)​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​
      )
    • 7:57 - Handling Live Zone Updates

      func workoutBuilder(_ workoutBuilder: HKLiveWorkoutBuilder,​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​
                          didUpdateWorkoutZone zoneUpdate: HKLiveWorkoutZoneUpdate) {​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​
          guard let zoneGroup = zoneUpdate.zoneGroup else {​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​
              return​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​
          }​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​
          if let currentIndex = zoneUpdate.currentZoneDuration?.zone.index {​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​
              let data = ZoneDisplayData(​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​
                  zoneCount: zoneGroup.configuration.zones.count,​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​
                  currentZoneIndex: currentIndex,​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​
                  durations: zoneGroup.zoneDurations.map(\.duration)​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​
              )​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​
              Task { @MainActor in​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​
                  self.heartRateZones = data​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​
              }​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​
          }​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​
      }
    • 9:19 - Check if Preferred Zone has been set

      if try await builder.zoneConfiguration(for: HKQuantityType(.heartRate)) == nil {
    • 9:24 - Create Zone Boundaries

      let defaultHeartRateZoneThresholds = [91.0, 114.0, 136.0, 158.0]​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​
          let bpmUnit = HKUnit.count().unitDivided(by: HKUnit.minute())​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​
          let boundaries = defaultHeartRateZoneThresholds.map(​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​
              {HKQuantity(unit: bpmUnit, doubleValue:$0)}
          )
    • 9:33 - Create Default Workout Zone Configuration

      let heartRate = HKQuantityType(.heartRate)​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​
          let defaultConfiguration = try HKWorkoutZoneConfiguration(quantityType: heartRate,​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​
                                                                    zoneBoundaries: boundaries)
    • 9:58 - Set Custom Zone Configuration

      try await builder.setCustomZoneConfiguration(defaultConfiguration,​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​
                                                       for: heartRate)​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​
      }
    • 10:03 - Begin Data Collection

      // Begin data collection
      let startDate = Date()​​​​​​​​​​​​​​
      try await builder.beginCollection(at: startDate)
    • 0:01 - Introduction
    • Workout zones turn biometric data into actionable training guidance, helping people understand their effort and intensity in a workout. In iOS and watchOS 27, heart rate and cycling power zone support is built directly into HealthKit, providing a new way to help people train smarter.

    • 2:17 - Accessing workout zones
    • Use the zoneGroupsByType dictionary on a completed HKWorkout or HKWorkoutActivity to access the zones for a particular HKQuantityType, like heart rate. Explore the HKWorkoutConfiguration (describing the quantity type, source, and contiguous zone boundaries) and an array of zone durations which represents the time spent in each zone during the workout. This data can be used to provide meaningful insights, like rendering a post-workout zone chart or classifying effort.

    • 6:19 - Live zone updates
    • To receive real-time notifications when someone's heart rate changes into a new zone during a workout, adopt the didUpdateWorkoutZone method on HKLiveWorkoutDelegate. Each update includes the current and previous zone, the cumulative zone data with running totals for the workout, and a timestamp of the last processed sample. Use these zone updates to provide timely guidance in a workout, like highlight the active zone and send an alert if someone drifts from their target zones.

    • 8:11 - Preferred zones
    • HealthKit uses the preferred zone thresholds from Health Settings by default, which can either be automatically calculated from user metrics like age and resting heart rate, or then be manually configured. These settings sync across devices. Before starting a workout that will consider zones information, query for a preferred zone configuration on HKHealthStore or HKWorkoutBuilder to confirm one has been set.

    • 9:00 - Custom zones
    • When your app uses a proprietary zone model, rather than the preferred zones from Health Settings, configure each workout with a custom HKWorkoutZoneConfiguration. Create the configuration and supply it to the HKWorkoutBuilder before calling beginCollection. Custom configurations are scoped to individual workouts and not persisted by HealthKit.

Developer Footer

  • 비디오
  • WWDC26
  • HealthKit 운동 영역을 사용해 운동 인사이트 제공하기
  • 메뉴 열기 메뉴 닫기
    • iOS
    • iPadOS
    • macOS
    • tvOS
    • visionOS
    • watchOS
    메뉴 열기 메뉴 닫기
    • Swift
    • SwiftUI
    • Swift Playground
    • TestFlight
    • Xcode
    • Xcode Cloud
    • SF Symbols
    메뉴 열기 메뉴 닫기
    • 손쉬운 사용
    • 액세서리
    • Apple Intelligence
    • 앱 확장 프로그램
    • App Store
    • 오디오 및 비디오(영문)
    • 증강 현실
    • 디자인
    • 배포
    • 교육
    • 서체(영문)
    • 게임
    • 건강 및 피트니스
    • 앱 내 구입
    • 현지화
    • 지도 및 위치
    • 머신 러닝 및 AI
    • 오픈 소스(영문)
    • 보안
    • Safari 및 웹(영문)
    메뉴 열기 메뉴 닫기
    • 문서(영문)
    • 튜토리얼
    • 다운로드
    • 포럼(영문)
    • 비디오
    메뉴 열기 메뉴 닫기
    • 지원 문서
    • 문의하기
    • 버그 보고
    • 시스템 상태(영문)
    메뉴 열기 메뉴 닫기
    • Apple Developer
    • App Store Connect
    • 인증서, 식별자 및 프로파일(영문)
    • 피드백 지원
    메뉴 열기 메뉴 닫기
    • Apple Developer Program
    • Apple Developer Enterprise Program
    • App Store Small Business Program
    • MFi Program(영문)
    • Mini Apps Partner Program
    • News Partner Program(영문)
    • Video Partner Program(영문)
    • Security Bounty Program(영문)
    • Security Research Device Program(영문)
    메뉴 열기 메뉴 닫기
    • Apple과의 만남
    • Apple Developer Center
    • App Store 어워드(영문)
    • Apple 디자인 어워드
    • Apple Developer Academy(영문)
    • WWDC
    최신 뉴스 읽기.
    Apple Developer 앱 받기.
    Copyright © 2026 Apple Inc. 모든 권리 보유.
    약관 개인정보 처리방침 계약 및 지침