View in English

  • Apple Developer
    • 今すぐ始める

    「今すぐ始める」を詳しく見る

    • 概要
    • 学ぶ
    • Apple Developer Program

    最新情報

    • 最新ニュース
    • Hello Developer
    • プラットフォーム

    プラットフォームを詳しく見る

    • Appleプラットフォーム
    • iOS
    • iPadOS
    • macOS
    • tvOS
    • visionOS
    • watchOS
    • App Store

    特集

    • デザイン
    • 配信
    • ゲーム
    • アクセサリ
    • Web
    • Home
    • CarPlay
    • テクノロジー

    テクノロジーを詳しく見る

    • 概要
    • Xcode
    • Swift
    • SwiftUI

    特集

    • アクセシビリティ
    • AIと機械学習
    • App Intent
    • Apple Intelligence
    • ゲーム
    • セキュリティ
    • Xcode Cloud
    • コミュニティ

    コミュニティを詳しく見る

    • 概要
    • 「Appleに相談」イベント
    • コミュニティイベント
    • デベロッパフォーラム
    • オープンソース

    特集

    • WWDC
    • Swift Student Challenge
    • デベロッパストーリー
    • App Store Awards
    • Apple Design Awards
    • Apple Developer Center
    • ドキュメント

    ドキュメントを詳しく見る

    • ドキュメントライブラリ
    • テクノロジー概要
    • サンプルコード
    • ヒューマンインターフェイスガイドライン
    • ビデオ

    リリースノート

    • 注目のアップデート
    • iOS
    • iPadOS
    • macOS
    • watchOS
    • visionOS
    • tvOS
    • Xcode
    • ダウンロード

    ダウンロードを詳しく見る

    • すべてのダウンロード
    • オペレーティングシステム
    • アプリ
    • デザインリソース

    特集

    • Xcode
    • TestFlight
    • フォント
    • SF Symbols
    • Icon Composer
    • サポート

    サポートを詳しく見る

    • 概要
    • ヘルプガイド
    • デベロッパフォーラム
    • フィードバックアシスタント
    • お問い合わせ

    特集

    • アカウントヘルプ
    • App Reviewガイドライン
    • App Reviewヘルプ
    • App Store Connectヘルプ
    • 近日導入予定の要件
    • 契約およびガイドライン
    • システムステータス
  • クイックリンク

    • イベント
    • ニュース
    • Forum
    • サンプルコード
    • ビデオ
 

ビデオ

メニューを開く メニューを閉じる
  • コレクション
  • すべてのビデオ
  • 利用方法

その他のビデオ

  • 概要
  • コード
  • Macへのライブアクティビティの導入

    Macアプリからライブアクティビティを配信・制御する方法を紹介します。ライブアクティビティがメニューバーやDynamic Islandにどのように表示されるかを解説します。データモデルの定義方法、SwiftUIを使用したコンパクト表示や拡大表示の作成方法、さらにApp Intentsを活用してインタラクティブなアップデートをトリガーする方法を学びます。

    関連する章

    • 0:00 - Introduction
    • 0:54 - Live Activities on Mac
    • 1:43 - Define the data model
    • 2:51 - Build the views
    • 4:40 - Start and update an activity
    • 5:38 - Add actions
    • 6:25 - End an activity
    • 6:44 - Next steps

    リソース

    • Starting and updating Live Activities with ActivityKit push notifications
    • Displaying live data with Live Activities
      • HDビデオ
      • SDビデオ

    関連ビデオ

    WWDC23

    • プッシュ通知によるライブアクティビティの更新
  • このビデオを検索
    • 2:36 - Define the Live Activity data model

      import ActivityKit
      
      struct CurtainActivityAttributes: ActivityAttributes {
          let scenesPerAct: [Int]
          let showTitle: String
      
          struct ContentState: Codable, Hashable {
              var isPlaying: Bool
              var curtainOpen: Bool
              var actIndex: Int
              var sceneIndexInAct: Int
          }
      }
    • 3:20 - Configure compact, minimal, and expanded views

      import SwiftUI
      import WidgetKit
      
      struct CurtainActivityWidget: Widget {
          var body: some WidgetConfiguration {
              ActivityConfiguration(
                  for: CurtainActivityAttributes.self
              ) { context in
                  CurtainActivityMenuBarExpandedContent(
                      state: context.state,
                      showTitle: context.attributes.showTitle)
              } dynamicIsland: { context in
                  DynamicIsland {
                      DynamicIslandExpandedRegion(.leading) {
                          CurtainLabel(state: context.state)
                      }
                      DynamicIslandExpandedRegion(.trailing) {
                          ActLabel(state: context.state)
                      }
                      DynamicIslandExpandedRegion(.center) {
                          SceneLabel(state: context.state)
                      }
                      DynamicIslandExpandedRegion(.bottom) {
                          ExpandedBottom(state: context.state)
                      }
                  } compactLeading: {
                      StatusGlyph(state: context.state)
                  } compactTrailing: {
                      CompactTrailing(state: context.state)
                  } minimal: {
                      StatusGlyph(state: context.state)
                  }
              }
          }
      }
    • 5:23 - Update a running Live Activity

      contentState.curtainOpen = false
      let content = ActivityContent(
          state: self.currentContentState, staleDate: nil
      )
      await activity.update(
          content, alertConfiguration: alertConfiguration
      )
    • 6:02 - Define an App Intent action

      struct SetPlacesReadyIntent: AppIntent {
          // ...
          func perform() async throws -> some IntentResult {
              // ...
              var state = activity.content.state
              state.placesReady = self.ready
              let content = ActivityContent(state: state, staleDate: nil)
              await activity.update(
                  content,
                  alertConfiguration: .announcement(self.ready ? "Ready" : "Not Ready")
              )
              return .result()
          }
      }
    • 6:16 - Trigger the intent from buttons

      private struct PlacesReadyButtons: View {
          var body: some View {
              HStack {
                  Button(intent: SetPlacesReadyIntent(ready: false)) {
                      Text("Not Ready")
                  }
                  .tint(.red)
                  Button(intent: SetPlacesReadyIntent(ready: true)) {
                      Text("Ready")
                  }
                  .tint(.green)
              }
          }
      }
    • 6:32 - End a Live Activity

      // End a Live Activity
      await activity.end(nil, dismissalPolicy: .immediate)

デベロッパ向けフッタ

  • ビデオ
  • Tech Talks
  • Macへのライブアクティビティの導入
  • メニューを開く メニューを閉じる
    • iOS
    • iPadOS
    • macOS
    • tvOS
    • visionOS
    • watchOS
    • App Store
    メニューを開く メニューを閉じる
    • Swift
    • SwiftUI
    • Swift Playground
    • TestFlight
    • Xcode
    • Xcode Cloud
    • Icon Composer
    • SF Symbols
    メニューを開く メニューを閉じる
    • アクセシビリティ
    • アクセサリ
    • AIと機械学習
    • Apple Intelligence
    • オーディオとビデオ
    • 拡張現実
    • ビジネス
    • デザイン
    • 配信
    • 教育
    • ゲーム
    • ヘルスケアとフィットネス
    • Appleアプリ内購入
    • ローカリゼーション
    • マップと位置情報
    • セキュリティ
    • Safari/Web
    メニューを開く メニューを閉じる
    • ドキュメント
    • ダウンロード
    • サンプルコード
    • ビデオ
    • ドキュメントのアーカイブ
    メニューを開く メニューを閉じる
    • ヘルプガイドと記事
    • お問い合わせ
    • フォーラム
    • フィードバックとバグの報告
    • システムステータス
    メニューを開く メニューを閉じる
    • Apple Developer
    • App Store Connect
    • Certificates, IDs, & Profiles(証明書、ID、プロファイル)
    • フィードバックアシスタント
    メニューを開く メニューを閉じる
    • 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 Research Device Program
    メニューを開く メニューを閉じる
    • Appleに相談
    • Apple Developer Center
    • App Store Awards
    • Apple Design Awards
    • Apple Developer Academy
    • WWDC
    最新ニュースを読む
    Apple Developerアプリを入手
    bilibili、LinkedIn、WeChat、YouTubeでフォロー
    Copyright © 2026 Apple Inc. All rights reserved.
    利用規約 プライバシーポリシー 契約とガイドライン