View in English

  • Apple Developer
    • Get Started

    Explore Get Started

    • Overview
    • Learn
    • Apple Developer Program

    Stay Updated

    • Latest News
    • Hello Developer
    • Platforms

    Explore Platforms

    • Apple Platforms
    • iOS
    • iPadOS
    • macOS
    • tvOS
    • visionOS
    • watchOS
    • App Store

    Featured

    • Design
    • Distribution
    • Games
    • Accessories
    • Web
    • Home
    • CarPlay
    • Technologies

    Explore Technologies

    • Overview
    • Xcode
    • Swift
    • SwiftUI

    Featured

    • Accessibility
    • App Intents
    • Apple Intelligence
    • Games
    • Machine Learning & AI
    • Security
    • Xcode Cloud
    • Community

    Explore Community

    • Overview
    • Meet with Apple events
    • Community-driven events
    • Developer Forums
    • Open Source

    Featured

    • WWDC
    • Swift Student Challenge
    • Developer Stories
    • App Store Awards
    • Apple Design Awards
    • Apple Developer Centers
    • Documentation

    Explore Documentation

    • Documentation Library
    • Technology Overviews
    • Sample Code
    • Human Interface Guidelines
    • Videos

    Release Notes

    • Featured Updates
    • iOS
    • iPadOS
    • macOS
    • watchOS
    • visionOS
    • tvOS
    • Xcode
    • Downloads

    Explore Downloads

    • All Downloads
    • Operating Systems
    • Applications
    • Design Resources

    Featured

    • Xcode
    • TestFlight
    • Fonts
    • SF Symbols
    • Icon Composer
    • Support

    Explore Support

    • Overview
    • Help Guides
    • Developer Forums
    • Feedback Assistant
    • Contact Us

    Featured

    • Account Help
    • App Review Guidelines
    • App Store Connect Help
    • Upcoming Requirements
    • Agreements and Guidelines
    • System Status
  • Quick Links

    • Events
    • News
    • Forums
    • Sample Code
    • Videos
 

Vidéos

Ouvrir le menu Fermer le menu
  • Collections
  • Toutes les vidéos
  • À propos

Plus de vidéos

  • À propos
  • Code
  • Discover Calendar and EventKit

    Discover how you can bring Calendar into your app and help people better manage their time. Find out how to create new events from your app, fetch events, and implement a virtual conference extension. We'll also take you through some of the changes to calendar access levels that help your app stay connected without compromising the privacy of someone's calendar data.

    Chapitres

    • 0:41 - Integrate with Calendar
    • 1:52 - Frameworks overview
    • 4:36 - Adding events
    • 4:56 - Adding: EventKitUI
    • 8:07 - Adding: Siri Event Suggestions
    • 10:59 - Adding: Write-only
    • 12:16 - Adding: EventKit
    • 14:23 - Full Access
    • 18:01 - Virtual conferences

    Ressources

    • Accessing Calendar using EventKit and EventKitUI
    • Explore the Human Interface Guidelines for privacy
    • EventKit
    • Universal Links for Developers
      • Vidéo HD
      • Vidéo SD

    Vidéos connexes

    WWDC23

    • What’s new in privacy

    WWDC20

    • Broaden your reach with Siri Event Suggestions
  • Rechercher dans cette vidéo…
    • 5:49 - Adding an event with EventKitUI

      // Create an event store
      let store = EKEventStore()
      
      // Create an event
      let event = EKEvent(eventStore: store)
      event.title = "WWDC23 Keynote"
      let startDateComponents = DateComponents(year: 2023, month: 6, day: 5, hour: 10)
      let startDate = Calendar.current.date(from: startDateComponents)!
      event.startDate = startDate
      event.endDate = Calendar.current.date(byAdding: .hour, value: 2, to: startDate)!
      event.timeZone = TimeZone(identifier: "America/Los_Angeles")
      event.location = "1 Apple Park Way, Cupertino, CA, United States"
      event.notes = "Kick off an exhilarating week of technology and community."
      
      // Create a view controller
      let eventEditViewController = EKEventEditViewController()
      eventEditViewController.event = event
      eventEditViewController.eventStore = store
      eventEditViewController.editViewDelegate = self
      
      // Present the view controller
      present(eventEditViewController, animated: true)
    • 9:17 - Siri Event Suggestions

      // Create an INReservation
      let spokenPhrase = “Lunch at Caffè Macs”
      let reservationReference = INSpeakableString(vocabularyIdentifier: "df9bc3f5",
                                                   spokenPhrase: spokenPhrase,
                                                   pronunciationHint: nil)
      let duration = INDateComponentsRange(start: myEventStart, end: myEventEnd)
      let location = CLPlacemark(location: myCLLocation,
                                 name: "Caffè Macs",
                                 postalAddress: myAddress)
      let reservation = INRestaurantReservation(itemReference: reservationReference,
                                                reservationStatus: .confirmed,
                                                reservationHolderName: "Jane Appleseed",
                                                reservationDuration: duration,
                                                restaurantLocation: location)
      
      // Create an intent and response
      let intent = INGetReservationDetailsIntent(reservationContainerReference:
          reservationReference)
      let intentResponse = INGetReservationDetailsIntentResponse(code: .success, userActivity: nil)
      intentResponse.reservations = [reservation]
      
      // Create an INInteraction
      let interaction = INInteraction(intent: intent, response: intentResponse)
      
      // Donate the interaction to the system
      interaction.donate()
    • 12:41 - Adding an event with write-only access

      // Create an event store
      let store = EKEventStore()
      
      // Request write-only access
      guard try await store.requestWriteOnlyAccessToEvents() else { return }
      
      // Create an event
      let event = EKEvent(eventStore: store)
      event.calendar = store.defaultCalendarForNewEvents
      event.title = "WWDC23 Keynote"
      event.startDate = myEventStartDate
      event.endDate = myEventEndDate
      event.timeZone = TimeZone(identifier: "America/Los_Angeles")
      event.location = "1 Apple Park Way, Cupertino, CA, United States"
      event.notes = "Kick off an exhilarating week of technology and community."
      
      // Save the event
      guard try eventStore.save(event, span: .thisEvent) else { return }
    • 15:51 - Fetch events

      // Create an event store
      let store = EKEventStore()
      
      // Request full access
      guard try await store.requestFullAccessToEvents() else { return }
      
      // Create a predicate
      guard let interval = Calendar.current.dateInterval(of: .month, for: Date()) else { return }
      let predicate = store.predicateForEvents(withStart: interval.start,
                                               end: interval.end,
                                               calendars: nil)
      
      // Fetch the events
      let events = store.events(matching: predicate)
      
      let sortedEvents = events.sorted { $0.compareStartDate(with: $1) == .orderedAscending }
    • 19:18 - Virtual conference extension

      // Create the extension target
      class VirtualConferenceProvider: EKVirtualConferenceProvider {
        
          // Provide the room types
          override func fetchAvailableRoomTypes() async throws ->
              [EKVirtualConferenceRoomTypeDescriptor] {
              let title = "My Room"
              let identifier = "my_room"
              let roomType = EKVirtualConferenceRoomTypeDescriptor(title: title, identifier: identifier)
              return [roomType]
          }
      
          // Provide the virtual conference
          override func fetchVirtualConference(identifier: EKVirtualConferenceRoomTypeIdentifier)
              async throws -> EKVirtualConferenceDescriptor {
              let urlDescriptor = EKVirtualConferenceURLDescriptor(title: nil, url: myURL)
              let details = "Enter the meeting code 12345 to enter the meeting."
              return EKVirtualConferenceDescriptor(title: nil,
                                                   urlDescriptors: [urlDescriptor],
                                                   conferenceDetails: details)
          }
        
      }

Developer Footer

  • Vidéos
  • WWDC23
  • Discover Calendar and EventKit
  • Open Menu Close Menu
    • iOS
    • iPadOS
    • macOS
    • tvOS
    • visionOS
    • watchOS
    • App Store
    Open Menu Close Menu
    • Swift
    • SwiftUI
    • Swift Playground
    • TestFlight
    • Xcode
    • Xcode Cloud
    • Icon Composer
    • SF Symbols
    Open Menu Close Menu
    • Accessibility
    • Accessories
    • Apple Intelligence
    • Audio & Video
    • Augmented Reality
    • Business
    • Design
    • Distribution
    • Education
    • Games
    • Health & Fitness
    • In-App Purchase
    • Localization
    • Maps & Location
    • Machine Learning & AI
    • Security
    • Safari & Web
    Open Menu Close Menu
    • Documentation
    • Downloads
    • Sample Code
    • Videos
    Open Menu Close Menu
    • Help Guides & Articles
    • Contact Us
    • Forums
    • Feedback & 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
    Read the latest news.
    Get the Apple Developer app.
    Copyright © 2026 Apple Inc. All rights reserved.
    Terms of Use Privacy Policy Agreements and Guidelines