View in English

  • Global Nav Open Menu Global Nav Close Menu
  • Apple Developer
Search
Cancel
  • Apple Developer
  • News
  • Discover
  • Design
  • Develop
  • Distribute
  • Support
  • Account
Only search within “”

Quick Links

5 Quick Links
  • sleep(_:)

    • Swift
    • Task
    • sleep(_:)

    • DOCUMENTATION
    • Swift
  • Sleep

    • DriverKit
    • IODispatchQueue
    • Sleep

    • DOCUMENTATION
    • Objective-C
  • sleep(_:)

    • RelevanceKit
    • sleep(_:)

    Tells the system a widget is relevant because of a person’s sleep schedule.

    • DOCUMENTATION
    • Swift
  • sleep(for:tolerance:)

    • Swift
    • Clock
    • sleep(for:tolerance:)

    Suspends for the given duration.

    • DOCUMENTATION
    • Swift
  • sleep(nanoseconds:)

    • Swift
    • Task
    • sleep(nanoseconds:)

    Suspends the current task for at least the given duration in nanoseconds.

    • DOCUMENTATION
    • Swift
  • sleep(until:)

    • Foundation
    • Thread
    • sleep(until:)

    Blocks the current thread until the time specified.

    • DOCUMENTATION
    • Swift
    • Objective-C
  • sleep(for:tolerance:)

    • Swift
    • ContinuousClock
    • sleep(for:tolerance:)

    Suspends for the given duration.

    • DOCUMENTATION
    • Swift
  • sleep(for:tolerance:)

    • Swift
    • SuspendingClock
    • sleep(for:tolerance:)

    Suspends for the given duration.

    • DOCUMENTATION
    • Swift
  • sleep(completion:)

    • Matter
    • MTRBaseClusterLowPower
    • sleep(completion:)

    • DOCUMENTATION
    • Swift
    • Objective-C
  • sleep_time

    • Kernel
    • thread_basic_info_data_t
    • sleep_time

    • DOCUMENTATION
    • Objective-C
  • watchOS 7 Release Notes

    Update your apps to use new features, and test your apps against API changes.

    • DOCUMENTATION ARTICLE
    • Swift
  • Interacting with your app in the iOS and iPadOS simulator

    Use your Mac to control interactions with your iOS and iPadOS apps in Simulator.

    • DOCUMENTATION ARTICLE
    • Swift
  • Samples

    Create and save health and fitness samples.

    • DOCUMENTATION ARTICLE
    • Swift
    • Objective-C
  • App Shortcuts

    An App Shortcut gives people access to your app’s key functions or content throughout the system.

    • DOCUMENTATION ARTICLE
    • Swift
  • Generating a Non-Maskable Interrupt

    Interrupt the kernel on a target Mac and attach a remote debugger to it.

    • DOCUMENTATION ARTICLE
    • Objective-C
  • Wrap-up: Observation and shareable data models

    Alphabetizer is your first iPad app and your first game. You defined data models separate from SwiftUI views using @Observable. Then you connected and shared those data models across multiple independent SwiftUI views.

    • DOCUMENTATION ARTICLE
    • Swift
  • Increasing the visibility of widgets in Smart Stacks

    Provide contextual information and donate intents to the system to make sure your widget appears prominently in Smart Stacks.

    • DOCUMENTATION ARTICLE
    • Swift
    • Objective-C
  • Understanding hangs in your app

    Determine the cause for delays in user interactions by examining the main thread and the main run loop.

    • DOCUMENTATION ARTICLE
    • Swift
  • Safari Technology Preview 63 Release Notes

    Preview the latest web technology updates including: Known Issue, Dark Mode, Stability, Custom Elements, Media, Web Animations, Web API, Accessibility, Web Inspector, Internationalization API, WebGL 2, and SVG.

    • DOCUMENTATION ARTICLE
    • Swift
  • iOS & iPadOS 26.1 Release Notes

    Update your apps to use new features, and test your apps against API changes.

    • DOCUMENTATION ARTICLE
    • Swift
  • About Threaded Programming

    Explains how to use threads in Cocoa applications.

  • Authentication and Authorization

    An introduction to computer security concepts and the security APIs in OS X and iOS.

  • Behind the Design: Headspace - Discover

    Find out how the Headspace team made its app

    • NEWS
  • Behind the Design: Odio - Discover

    Discover how this app conjures up its 3D soundscapes.

    • NEWS
  • Behind the Design: Rebel Girls - Discover

    Find out how the groundbreaking book became an ADA-winning app.

    • NEWS
  • End-User Security Features

    An introduction to computer security concepts and the security APIs in OS X and iOS.

  • Energy Efficiency Guide for iOS Apps: Fundamental Concepts

    Provides guidelines and recommendations for developing energy efficient iOS apps that help users achieve great battery life.

  • Energy Efficiency Guide for iOS Apps: Measure Energy Impact with Instruments

    Provides guidelines and recommendations for developing energy efficient iOS apps that help users achieve great battery life.

  • Energy Efficiency Guide for iOS Apps: Observe Signs of Energy Leaks

    Provides guidelines and recommendations for developing energy efficient iOS apps that help users achieve great battery life.

  • Energy Efficiency Guide for Mac Apps: Minimize Timer Usage

    Explains how app developers can reduce energy impact on computers running OS X.

  • Energy Efficiency Guide for Mac Apps: Monitor Usage Regularly

    Explains how app developers can reduce energy impact on computers running OS X.

  • Energy Efficiency Guide for Mac Apps: Observe Signs of Energy Leaks

    Explains how app developers can reduce energy impact on computers running OS X.

  • Energy Efficiency Guide for Mac Apps: Prioritize Work at the App Level

    Explains how app developers can reduce energy impact on computers running OS X.

  • Finding Memory Leaks

    Guidelines for improving the performance of memory-related code.

  • Glossary

    Explains how to use threads in Cocoa applications.

  • How to make your app a global success - Articles

    Three international developers share their experiences about expanding their apps to a global audience.  ͏

  • Incorporating Controllers into Your Game

    Describes how to add support for hardware game controllers to an app.

  • I/O Kit Family Reference

    The basics of developing device drivers. Includes descriptions of I/O Kit families.

  • Mac OS X Manual Page For free(3)

    HTML versions of the iOS man pages.

  • Mac OS X Manual Page For malloc(3)

    HTML versions of the iOS man pages.

  • Mac OS X Manual Page For valloc(3)

    HTML versions of the iOS man pages.

  • Managing Power

    The basics of developing device drivers. Includes descriptions of I/O Kit families.

  • Other Tools and Information

    Provides a guided tour of (Bourne) shell scripting, including control structures, numerical computation, regular expressions, subroutines, and error handling.

  • Run Loops

    Explains how to use threads in Cocoa applications.

  • Synchronization Primitives

    Essential information for programming in the OS X kernel. Includes a high-level overview.

  • 14:16

    What’s new in watchOS 11

    Explore new opportunities on Apple Watch, including bringing Double Tap support to your watchOS app, making your Smart Stack widgets even more...

    • WWDC24 VIDEO
    • 00:03:13

      Sleep, including the bedtime and wakeup time

    • 00:04:09

      For example, if you have a sleep data widget,

    • 00:04:15

      You can use the .sleep relevant context to have the system suggest your widget

  • 14:20

    Explore wellbeing APIs in HealthKit

    Learn how to incorporate mental health and wellbeing into your app using HealthKit. There are new APIs for State of Mind, as well as for Depression...

    • WWDC24 VIDEO
    • 00:08:12

      like that you feel poorly when you aren’t getting enough sleep

    • 00:08:31

      like Exercise Minutes, Mindful Minutes, or Sleep.

  • 1:45

    Monday@WWDC

    It's been a jam-packed first day at WWDC, full of exciting news from the Keynote and Platforms State of the Union. We'll zoom through the highlights...

    • WWDC 2020 VIDEO
    • 00:00:44

      There's Face Sharing and a new Sleep app.

  • 23:30

    Writing for interfaces

    • WWDC22 VIDEO
    • 00:08:06

      Let's say it's a weekend and you've decided to sleep in,

    • 00:08:32

      When you head to bed, the lock screen says "Sleep Well"

    • 00:08:35

      and tells you that Sleep Focus is on.

    • 00:08:42

      "Sleep Well" has a friendly and familiar tone,

    • 00:08:45

      and acknowledges that you're going to sleep.

    • 00:08:58

      Would you like to turn off your alarm and sleep mode?"

  • 108:53

    Keynote (ASL)

    The Apple Worldwide Developers Conference kicks off with exciting reveals, inspiration, and new opportunities. Join the worldwide developer community...

    • WWDC22 VIDEO
    • 00:13:56

      like listening to bedtime stories together with Better Sleep

    • 00:49:31

      Sumbul Ahmad Desai: The Sleep app has helped millions of you

    • 00:49:33

      by providing insights into how much sleep you're getting

    • 00:49:41

      In watchOS 9, you'll be able to learn more about your sleep with Sleep Stages.

    • 00:49:50

      to detect which stage of sleep you're in.

    • 00:50:12

      that each sleep stage– REM, Core, and Deep–

    • 00:50:18

      And as you sleep, you're likely to cycle through these stages multiple times.

    • 00:50:22

      Researchers are still looking into what happens during sleep

  • 20:13

    Design App Shortcuts

    • WWDC22 VIDEO
    • 00:03:08

      Start sleep meditation.

    • 00:08:20

      and each parameterized version, like Start Sleep Meditation,

    • 00:16:34

      Focus, Gratitude, Walking, Compassion, or Sleep?

  • 108:53

    Keynote

    The Apple Worldwide Developers Conference kicks off with exciting reveals, inspiration, and new opportunities. Join the worldwide developer community...

    • WWDC22 VIDEO
    • 00:13:56

      like listening to bedtime stories together with Better Sleep

    • 00:49:31

      Sumbul Ahmad Desai: The Sleep app has helped millions of you

    • 00:49:33

      by providing insights into how much sleep you're getting

    • 00:49:41

      In watchOS 9, you'll be able to learn more about your sleep with Sleep Stages.

    • 00:49:50

      to detect which stage of sleep you're in.

    • 00:50:12

      that each sleep stage– REM, Core, and Deep–

    • 00:50:18

      And as you sleep, you're likely to cycle through these stages multiple times.

    • 00:50:22

      Researchers are still looking into what happens during sleep

  • 24:25

    What's new in HealthKit

    • WWDC22 VIDEO
    • 00:00:29

      One of the most popular is sleep tracking,

    • 00:00:35

      to capture more detailed sleep data.

    • 00:01:17

      Sleep is such an essential function

    • 00:01:23

      and I love using my Apple Watch to manage my sleep schedule

    • 00:01:30

      and improve my sleep.

    • 00:01:33

      This year we are making sleep tracking even better

    • 00:01:37

      by introducing sleep stages.

    • 00:01:43

      all the different sleep stages you go through

  • 13:01

    Meet Swift Async Algorithms

    • WWDC22 VIDEO
    • 00:06:32

      it suspends when the machine is put to sleep.

    • 00:06:40

      to clock sleep function to handle dismissing alerts after a deadline.

  • 15:55

    Build a research and care app, part 2: Schedule tasks

    • WWDC21 VIDEO
    • 00:01:04

      where we ask the participants about how much sleep they got

    • 00:05:03

      between the amount of sleep a participant gets

    • 00:06:44

      and that we've changed the min to 0 hours of sleep

    • 00:06:47

      and the max to 12 hours of sleep.

    • 00:07:42

      and then for the sleep item identifier.

    • 00:08:22

      and the sleep answer is the first one

    • 00:08:24

      marked with the sleep identifier.

    • 00:08:36

      one for sleep and one for pain.

Developer Footer

  • Search
  • Open Menu Close Menu
    • iOS
    • iPadOS
    • macOS
    • tvOS
    • visionOS
    • watchOS
    Open Menu Close Menu
    • Swift
    • SwiftUI
    • Swift Playground
    • TestFlight
    • Xcode
    • Xcode Cloud
    • Icon Composer
    • SF Symbols
    Open Menu Close Menu
    • Accessibility
    • Accessories
    • Apple Intelligence
    • App Store
    • Audio & Video
    • Augmented Reality
    • Business
    • Design
    • Distribution
    • Education
    • Fonts
    • Games
    • Health & Fitness
    • In-App Purchase
    • Localization
    • Maps & Location
    • Machine Learning & AI
    • Open Source
    • Security
    • Safari & Web
    Open Menu Close Menu
    • Documentation
    • Sample Code
    • Tutorials
    • Downloads
    • Forums
    • Videos
    Open Menu Close Menu
    • Support Articles
    • Contact Us
    • Bug Reporting
    • System Status
    Open Menu Close Menu
    • Apple Developer
    • App Store Connect
    • Certificates, IDs, & Profiles
    • Feedback Assistant
    Open Menu Close Menu
    • 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
    Open Menu Close Menu
    • Meet with Apple
    • Apple Developer Centers
    • App Store Awards
    • Apple Design Awards
    • Apple Developer Academies
    • WWDC
    Get the Apple Developer app.
    Copyright © 2026 Apple Inc. All rights reserved.
    Terms of Use Privacy Policy Agreements and Guidelines