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
 

Videos

Abrir menú Cerrar menú
  • Colecciones
  • Todos los videos
  • Información

Más videos

  • Información
  • Código
  • Enhance your iPad and iPhone apps for the Shared Space

    Get ready to enhance your iPad and iPhone apps for the Shared Space! We'll show you how to optimize your experience to make it feel great on visionOS and explore Designed for iPad app interaction, visual treatments, and media.

    Capítulos

    • 1:00 - Interaction
    • 7:55 - Visuals
    • 8:57 - Media

    Recursos

      • Video HD
      • Video SD

    Videos relacionados

    WWDC23

    • Build great games for spatial computing
    • Explore App Store Connect for spatial computing
    • Run your iPad and iPhone apps in the Shared Space

    WWDC20

    • Advancements in Game Controllers
  • Buscar este video…
    • 3:02 - Tappable VStack with hover effect

      struct TappableCard: View {
         // Sample card
         var imageName = "BearsInWater"
         var headline = "Bear Fishing"
         var timeAgo = "42 Minutes ago"
         
         var body: some View {
            VStack {
               VStack(alignment: .leading) {
                  Image(imageName)
                     .resizable()
                     .clipped()
                     .aspectRatio(contentMode: .fill)
                     .frame(width: 300, height: 250, alignment: .center)
                  Text(headline)
                     .padding([.leading])
                     .font(.title2)
                     .foregroundColor(.black)
               }
               Divider()
               HStack {
                  HStack {
                     Text(timeAgo)
                        .frame(alignment: .leading)
                        .foregroundColor(.black)
                  }
                  .padding([.leading])
                  Spacer()
                  VStack(alignment: .trailing) {
                     Button { print("Present menu options") } label: {
                        Image(systemName: "ellipsis")
                           .foregroundColor(.black)
                     }
                  }
               }
               .padding(EdgeInsets(top: 5, leading: 5, bottom: 5, trailing: 5))
            }
            .frame(width: 300, height: 350, alignment: .top)
            .hoverEffect()
            .background(.white)
            .overlay(
               RoundedRectangle(cornerRadius: 10)
                  .stroke(Color(.sRGB, red: 150/255, green: 150/255, blue: 150/255, opacity: 0.1), lineWidth: 3.0)
            )
            .cornerRadius(10)
            .onTapGesture {
               print("Present card detail")
            }
         }
      }
    • 4:08 - Custom player with tap targets that are larger than the hover effect bounds

      struct ContentView: View {
         var body: some View {
            VStack {
               // Video player
               HStack {
                  Button { print("Going back 10 seconds") } label: {
                     Image(systemName: "gobackward.10")
                        .padding(.trailing)
                        .contentShape(.hoverEffect, CustomizedRectShape(customRect: CGRect(x: -75, y: -40, width: 100, height: 100)))
                        .foregroundStyle(.white)
                        .frame(width: 500, height: 834, alignment: .trailing)
                  }
                  Button { print("Play") } label: {
                     Image(systemName: "play.fill")
                        .font(.title)
                        .foregroundStyle(.white)
                        .frame(width: 100, height: 100, alignment: .center)
                  }
                  .padding()
                  Button { print("Going into the future 10 seconds") } label: {
                     Image(systemName: "goforward.10")
                        .padding(.leading)
                        .contentShape(.hoverEffect, CustomizedRectShape(customRect: CGRect(x: 0, y: -40, width: 100, height: 100)))
                        .foregroundStyle(.white)
                        .frame(width: 500, height: 834, alignment: .leading)
                  }
               }
               .frame(
                    minWidth: 0,
                    maxWidth: .infinity,
                    minHeight: 0,
                    maxHeight: .infinity,
                    alignment: .center
               )
            }
            .frame(
                 minWidth: 0,
                 maxWidth: .infinity,
                 minHeight: 0,
                 maxHeight: .infinity,
                 alignment: .topLeading
            )
            .background(.black)
         }
      }
      
      struct CustomizedRectShape: Shape {
         var customRect: CGRect
         
         func path(in rect: CGRect) -> Path {
            var path = Path()
            
            path.move(to: CGPoint(x: customRect.minX, y: customRect.minY))
            path.addLine(to: CGPoint(x: customRect.maxX, y: customRect.minY))
            path.addLine(to: CGPoint(x: customRect.maxX, y: customRect.maxY))
            path.addLine(to: CGPoint(x: customRect.minX, y: customRect.maxY))
            path.addLine(to: CGPoint(x: customRect.minX, y: customRect.minY))
            
            return path
         }
      }
    • 5:14 - Button with custom buttonStyle, then adding a hover effect to the button

      struct ContentView: View {
          var body: some View {
              VStack {
               Button("Howdy y'all") { print("🤠") }
                  .buttonStyle(SixColorButton())
              }
              .padding()
          }
      }
      
      struct SixColorButton: ButtonStyle {
         func makeBody(configuration: Configuration) -> some View {
            configuration.label
               .padding()
               .font(.title)
               .foregroundStyle(.white)
               .bold()
               .background {
                  // Background color bands
                  ZStack {
                     Color.black
                     HStack(spacing: 0) {
                        // GREEN
                        Rectangle()
                           .foregroundStyle(Color(red: 125/255, green: 186/255, blue: 66/255))
                           .frame(width: 16)
                        // YELLOW
                        Rectangle()
                           .foregroundStyle(Color(red: 240/255, green: 187/255, blue: 64/255))
                           .frame(width: 16)
                        // ORANGE
                        Rectangle()
                           .foregroundStyle(Color(red: 225/255, green: 137/255, blue: 50/255))
                           .frame(width: 16)
                        // RED
                        Rectangle()
                           .foregroundStyle(Color(red: 200/255, green: 73/255, blue: 65/255))
                           .frame(width: 16)
                        // PURPLE
                        Rectangle()
                           .foregroundStyle(Color(red: 134/255, green: 64/255, blue: 151/255))
                           .frame(width: 16)
                        // BLUE
                        Rectangle()
                           .foregroundStyle(Color(red: 75/255, green: 154/255, blue: 218/255))
                           .frame(width: 16, height: 500)
                     }
                     .opacity(0.7)
                     .rotationEffect(.degrees(35))
                  }
               }
               .cornerRadius(10)
               .hoverEffect()
         }
      }
    • 5:46 - Honey comb app with custom shape buttons, then adding hover effects that clip to bounds of the honey comb shape

      struct ContentView: View {
          var body: some View {
            VStack {
               Button { print("🐝") } label: {
                  // Button label
                  HoneyComb()
                     .fill(.yellow)
                     .frame(width: 300, height: 300)
                     .contentShape(.hoverEffect, HoneyComb())
                  }
               }
               .frame(width: 400, height: 400, alignment: .center)
               .background(.black)
               .padding()
            }
          }
      }
      
      struct HoneyComb: Shape {
         func path(in rect: CGRect) -> Path {
            var path = Path()
            path.move(to: CGPoint(x: rect.minX + (rect.width * 0.25), y: rect.minY))
            path.addLine(to: CGPoint(x: rect.maxX - (rect.maxX * 0.25), y: rect.minY))
            path.addLine(to: CGPoint(x: rect.maxX, y: rect.midY))
            path.addLine(to: CGPoint(x: rect.maxX - (rect.maxX * 0.25), y: rect.maxY))
            path.addLine(to: CGPoint(x: rect.minX + (rect.width * 0.25), y: rect.maxY))
            path.addLine(to: CGPoint(x: rect.minX, y: rect.midY))
            path.addLine(to: CGPoint(x: rect.minX + (rect.width * 0.25), y: rect.minY))
            return path
         }
      }

Developer Footer

  • Videos
  • WWDC23
  • Enhance your iPad and iPhone apps for the Shared Space
  • 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