View in English

  • メニューを開く メニューを閉じる
  • Apple Developer
検索
検索を終了
  • Apple Developer
  • ニュース
  • 見つける
  • デザイン
  • 開発
  • 配信
  • サポート
  • アカウント
次の内容に検索結果を絞り込む

クイックリンク

5 クイックリンク

ビデオ

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

その他のビデオ

ストリーミングはほとんどのブラウザと
Developerアプリで視聴できます。

  • 概要
  • コード
  • SwiftUIアニメーションの詳細

    SwiftUIの有能なアニメーション機能がどのように印象的な視覚効果を生み出すかを学びましょう。SwiftUIがどのようにViewを再レンダリングし、何をアニメーションさせるかを決定し、値を補間し、直近のトランザクションのコンテキストを伝達するかを学びましょう。

    関連する章

    • 1:03 - Anatomy of an update
    • 6:40 - Animatable
    • 11:36 - Animation
    • 20:00 - Transaction

    リソース

      • HDビデオ
      • SDビデオ

    関連ビデオ

    WWDC23

    • Springsでアニメーション生成
    • SwiftUIのパフォーマンスを解明
    • SwiftUIの新機能
    • SwiftUIの高度なアニメーションの世界
    • SwiftUI向けのMapKitについて
  • ダウンロード
    Array
    • 2:14 - Pet Avatar - Unanimated

      struct Avatar: View {
          var pet: Pet
          @State private var selected: Bool = false
      
          var body: some View {
              Image(pet.type)
                  .scaleEffect(selected ? 1.5 : 1.0)
                  .onTapGesture {
                      selected.toggle()
                  }
          }
      }
    • 4:13 - Pet Avatar - Animated

      struct Avatar: View {
          var pet: Pet
          @State private var selected: Bool = false
      
          var body: some View {
              Image(pet.type)
                  .scaleEffect(selected ? 1.5 : 1.0)
                  .onTapGesture {
                      withAnimation {
                          selected.toggle()
                      }
                  }
          }
      }
    • 11:49 - Pet Avatar - Explicit Animation

      struct Avatar: View {
          var pet: Pet
          @State private var selected: Bool = false
      
          var body: some View {
              Image(pet.type)
                  .scaleEffect(selected ? 1.5 : 1.0)
                  .onTapGesture {
                      withAnimation(.bouncy) {
                          selected.toggle()
                      }
                  }
          }
      }
    • 12:48 - UnitCurve Model

      let curve = UnitCurve(
          startControlPoint: UnitPoint(x: 0.25, y: 0.1),
          endControlPoint: UnitPoint(x: 0.25, y: 1))
      curve.value(at: 0.25)
      curve.velocity(at: 0.25)
    • 13:56 - Spring Model

      let spring = Spring(duration: 1.0, bounce: 0)
      spring.value(target: 1, time: 0.25)
      spring.velocity(target: 1, time: 0.25)
    • 17:25 - MyLinearAnimation

      struct MyLinearAnimation: CustomAnimation {
          var duration: TimeInterval
      
          func animate<V: VectorArithmetic>(
              value: V,
              time: TimeInterval,
              context: inout AnimationContext<V>
          ) -> V? {
              if time <= duration {
                  value.scaled(by: time / duration)
              } else {
                  nil // animation has finished
              }
          }
      }
    • 19:50 - MyLinearAnimation with Velocity

      struct MyLinearAnimation: CustomAnimation {
          var duration: TimeInterval
      
          func animate<V: VectorArithmetic>(
              value: V, time: TimeInterval, context: inout AnimationContext<V>
          ) -> V? {
              if time <= duration {
                  value.scaled(by: time / duration)
              } else {
                  nil // animation has finished
              }
          }
      
          func velocity<V: VectorArithmetic>(
              value: V, time: TimeInterval, context: AnimationContext<V>
          ) -> V? {
              value.scaled(by: 1.0 / duration)
          }
      }
    • 22:44 - Pet Avatar - Animation Modifier

      struct Avatar: View {
          var pet: Pet
          @Binding var selected: Bool
      
          var body: some View {
              Image(pet.type)
                  .scaleEffect(selected ? 1.5 : 1.0)
                  .animation(.bouncy, value: selected)
                  .onTapGesture {
                      selected.toggle()
                  }
          }
      }
    • 23:44 - Pet Avatar - Multiple Animation Modifiers

      struct Avatar: View {
          var pet: Pet
          @Binding var selected: Bool
      
          var body: some View {
              Image(pet.type)
                  .shadow(radius: selected ? 12 : 8)
                  .animation(.smooth, value: selected)
                  .scaleEffect(selected ? 1.5 : 1.0)
                  .animation(.bouncy, value: selected)
                  .onTapGesture {
                      selected.toggle()
                  }
          }
      }
    • 25:20 - Generic Avatar - Scoped Animation Modifiers

      struct Avatar<Content: View>: View {
          var content: Content
          @Binding var selected: Bool
      
          var body: some View {
              content
                  .animation(.smooth) {
                      $0.shadow(radius: selected ? 12 : 8)
                  }
                  .animation(.bouncy) {
                      $0.scaleEffect(selected ? 1.5 : 1.0)
                  }
                  .onTapGesture {
                      selected.toggle()
                  }
          }
      }
    • 28:45 - Pet Avatar - Transaction Modifier

      struct Avatar: View {
          var pet: Pet
          @Binding var selected: Bool
      
          var body: some View {
              Image(pet.type)
                  .scaleEffect(selected ? 1.5 : 1.0)
                  .transaction(value: selected) {
                      $0.animation = $0.avatarTapped
                          ? .bouncy : .smooth
                  }
                  .onTapGesture {
                      withTransaction(\.avatarTapped, true) {
                          selected.toggle()
                      }
                  }
          }
      }
      
      private struct AvatarTappedKey: TransactionKey {
          static let defaultValue = false
      }
      
      extension Transaction {
          var avatarTapped: Bool {
              get { self[AvatarTappedKey.self] }
              set { self[AvatarTappedKey.self] = newValue }
          }
      }
    • 28:58 - Generic Avatar - Scoped Transaction Modifier

      struct Avatar<Content: View>: View {
          var content: Content
          @Binding var selected: Bool
      
          var body: some View {
              content
                  .transaction {
                      $0.animation = $0.avatarTapped
                          ? .bouncy : .smooth
                  } body: {
                      $0.scaleEffect(selected ? 1.5 : 1.0)
                  }
                  .onTapGesture {
                      withTransaction(\.avatarTapped, true) {
                          selected.toggle()
                      }
                  }
          }
      }
      
      private struct AvatarTappedKey: TransactionKey {
          static let defaultValue = false
      }
      
      extension Transaction {
          var avatarTapped: Bool {
              get { self[AvatarTappedKey.self] }
              set { self[AvatarTappedKey.self] = newValue }
          }
      }
  • 特定のトピックをお探しの場合は、上にトピックを入力すると、関連するトピックにすばやく移動できます。

    クエリの送信中にエラーが発生しました。インターネット接続を確認して、もう一度お試しください。

Developer Footer

  • ビデオ
  • WWDC23
  • SwiftUIアニメーションの詳細
  • メニューを開く メニューを閉じる
    • iOS
    • iPadOS
    • macOS
    • tvOS
    • visionOS
    • watchOS
    Open Menu Close Menu
    • Swift
    • SwiftUI
    • Swift Playground
    • TestFlight
    • Xcode
    • Xcode Cloud
    • SF Symbols
    メニューを開く メニューを閉じる
    • アクセシビリティ
    • アクセサリ
    • App Extension
    • App Store
    • オーディオとビデオ(英語)
    • 拡張現実
    • デザイン
    • 配信
    • 教育
    • フォント(英語)
    • ゲーム
    • ヘルスケアとフィットネス
    • アプリ内課金
    • ローカリゼーション
    • マップと位置情報
    • 機械学習
    • オープンソース(英語)
    • セキュリティ
    • SafariとWeb(英語)
    メニューを開く メニューを閉じる
    • 英語ドキュメント(完全版)
    • 日本語ドキュメント(一部トピック)
    • チュートリアル
    • ダウンロード(英語)
    • フォーラム(英語)
    • ビデオ
    Open Menu Close Menu
    • サポートドキュメント
    • お問い合わせ
    • バグ報告
    • システム状況(英語)
    メニューを開く メニューを閉じる
    • Apple Developer
    • App Store Connect
    • Certificates, IDs, & Profiles(英語)
    • フィードバックアシスタント
    メニューを開く メニューを閉じる
    • Apple Developer Program
    • Apple Developer Enterprise Program
    • App Store Small Business Program
    • MFi Program(英語)
    • News Partner Program(英語)
    • Video Partner Program(英語)
    • セキュリティ報奨金プログラム(英語)
    • Security Research Device Program(英語)
    Open Menu Close Menu
    • Appleに相談
    • Apple Developer Center
    • App Store Awards(英語)
    • Apple Design Awards
    • Apple Developer Academy(英語)
    • WWDC
    Apple Developerアプリを入手する
    Copyright © 2025 Apple Inc. All rights reserved.
    利用規約 プライバシーポリシー 契約とガイドライン