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
 

Vídeos

Abrir menu Fechar menu
  • Coleções
  • Todos os vídeos
  • Sobre

Mais vídeos

  • Sobre
  • Código
  • Optimize the interface of your Mac Catalyst app

    Discover how to tailor your Mac Catalyst app so that it looks and feels even more at home on the Mac by using the new “Optimize Interface for Mac” option in Xcode. Explore new layout and appearance options for Catalyst apps, and learn how they can provide you with graphical performance gains, sharper text, and an interface designed specifically for Apple's desktops and laptops. We'll show you how to take advantage of these options and provide best practices for organizing your code when developing for multiple platforms.

    Developers actively working on a Mac Catalyst project will get the most out of watching this session. If you're new to Catalyst, we recommend watching “Designing iPad Apps for Mac” and "Introducing iPad Apps for Mac" for an introduction.

    For more on working with Mac Catalyst, check out "What's new in Mac Catalyst”

    Recursos

    • Human Interface Guidelines: Mac Catalyst
    • Mac Catalyst
    • Optimizing your iPad app for Mac
    • Adding menus and shortcuts to the menu bar and user interface
      • Vídeo HD
      • Vídeo SD

    Vídeos relacionados

    WWDC21

    • Qualities of a great Mac Catalyst app
    • What's new in Mac Catalyst

    WWDC20

    • Build with iOS pickers, menus and actions
    • Design with iOS pickers, menus and actions
    • What's new in Mac Catalyst
    • What's new in SwiftUI

    WWDC19

    • Designing iPad Apps for Mac
    • Font Management and Text Scaling
    • Introducing iPad Apps for Mac
  • Buscar neste vídeo...
    • 22:04 - Hide Navigation Bar in Mac Idiom

      if traitCollection.userInterfaceIdiom == .mac {
          navigationController?.setNavigationBarHidden(true, animated: false)
      }
    • 29:33 - Idiom vs conditional compilation block

      // Idiom vs conditional compilation block
      
      if traitCollection.userInterfaceIdiom == .mac {
          // "Optimize Interface for Mac" specific code
      }
      
      
      #if targetEnvironment(macCatalyst)
          // Mac Catalyst specific code
      #endif
      
      
      if traitCollection.userInterfaceIdiom == .mac {
          // "Optimize Interface for Mac" specific code
      } else if traitCollection.userInterfaceIdiom == .pad {
          #if targetEnvironment(macCatalyst)
              // Mac Catalyst specific code
          #else
              // iPad specific code
          #endif
      }
    • 31:26 - SwiftUI GroupBox

      // Nested GroupBoxes
      
      struct ContentView: View {
          var body: some View {
              GroupBox {
                  VStack {
                      Text("High level information")
                      GroupBox {
                          Text("Some elaborate details")
                      }
                  }
              }
          }
      }
    • 32:00 - SwiftUI Toggle

      // DefaultToggleStyle
      
      struct ContentView: View {
          @State var completed: Bool = false
      
          var body: some View {
              Toggle("Complete?", isOn: $completed)
          }
      }
    • 32:35 - SwiftUI Button

      // System Button with SF Symbol
      
      struct ContentView: View {
          var body: some View {
              Button(action: { }, label: {
                  HStack {
                      Image(systemName: "rays")
                      Text("Click Me!")
                  }
              })
          }
      }
    • 32:56 - SwiftUI DatePicker

      // DefaultDatePickerStyle
      
      struct ContentView: View {
          @State var dueDate = Date()
      
          var body: some View {
              DatePicker("Due:", selection: $dueDate)
          }
      }
    • 33:14 - SwiftUI Picker

      // DefaultPickerStyle
      
      struct ContentView: View {
          @State var sizeIndex = 2
      
          var body: some View {
              Picker("Size:", selection: $sizeIndex) {
                  Text("Small").tag(1)
                  Text("Medium").tag(2)
                  Text("Large").tag(3)
              }
          }
      }
    • 33:55 - SwiftUI Nineties Style Button

      // Custom gradient button
      
      struct CustomNinetiesButtonStyle: ButtonStyle {
          var angle: Angle = .degrees(54.95)
      
          func gradient(shifted: Bool) -> AngularGradient {
              let lightTeal = Color(#colorLiteral(red: 0.2785285413, green: 0.9299042821, blue: 0.9448828101, alpha: 1))
              let yellow    = Color(#colorLiteral(red: 0.9300076365, green: 0.8226149678, blue: 0.59575665, alpha: 1))
              let pink      = Color(#colorLiteral(red: 0.9437599778, green: 0.3392140865, blue: 0.8994731307, alpha: 1))
              let purple    = Color(#colorLiteral(red: 0.5234025717, green: 0.3247769475, blue: 0.9921132922, alpha: 1))
              let softBlue  = Color(#colorLiteral(red: 0.137432307, green: 0.5998355746, blue: 0.9898411632, alpha: 1))
      
              let gradient = Gradient(stops:
                                          [.init(color:lightTeal, location: 0.2),
                                           .init(color: softBlue, location: 0.4),
                                           .init(color: purple, location: 0.6),
                                           .init(color: pink, location: 0.8),
                                           .init(color: yellow, location: 1.0)])
      
              return AngularGradient(gradient: gradient, center: .init(x: 0.25, y: 0.55), angle: shifted ? angle : .zero)
          }
      
          func makeBody(configuration: ButtonStyleConfiguration) -> some View {
              let background = NinetiesBackground(isPressed: configuration.isPressed,
                                                  pressedGradient: gradient(shifted: false),
                                                  unpressedGradient: gradient(shifted: true))
              return configuration.label
                  .foregroundColor(configuration.isPressed ? Color.pink : Color.white)
                  .modifier(background)
          }
      
          struct NinetiesBackground: ViewModifier {
              let isPressed: Bool
              let pressedGradient: AngularGradient
              let unpressedGradient: AngularGradient
      
              func body(content: Content) -> some View {
                  let foreground = content
                          .padding(.horizontal, 24)
                          .padding(.vertical, 14)
                          .foregroundColor(.white)
                  return foreground
                      .background(Capsule().fill(isPressed ? pressedGradient : unpressedGradient))
              }
          }
      }
      struct ContentView: View {
      
          var body: some View {
            Button("Awesome", action: {})
                .buttonStyle(CustomNinetiesButtonStyle())
          }
      }

Developer Footer

  • Vídeos
  • WWDC20
  • Optimize the interface of your Mac Catalyst app
  • 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