-
What's new in UIKit
Discover the latest updates and improvements to UIKit and learn how to build better iPadOS, iOS, and Mac Catalyst apps. We'll take you through UI refinements, productivity updates, API enhancements, and more. We'll also help you explore improvements to performance, security, and privacy.
Ressources
- UINavigationItem.ItemStyle
- UIPageControl
- UICalendarView
- centerItemGroups
- Building a desktop-class iPad app
Vidéos connexes
WWDC22
- Adopt desktop-class editing interactions
- Adopt Variable Color in SF Symbols
- Build a desktop-class iPad app
- Eliminate data races using Swift Concurrency
- Meet desktop-class iPad
- Use SwiftUI with UIKit
- Visualize and optimize Swift concurrency
- What's new in SF Symbols 4
- What's new in TextKit and text views
WWDC21
-
Rechercher dans cette vidéo…
-
-
7:51 - Configuring a UICalendarView with multi-date selection
// Configuring a calendar view with multi-date selection let calendarView = UICalendarView() calendarView.delegate = self calendarView.calendar = Calendar(identifier: .gregorian) view.addSubview(calendarView) let multiDateSelection = UICalendarSelectionMultiDate(delegate: self) multiDateSelection.selectedDates = myDatabase.selectedDates() calendarView.selectionBehavior = multiDateSelection func multiDateSelection( _ selection: UICalendarSelectionMultiDate, canSelectDate dateComponents: DateComponents ) -> Bool { return myDatabase.hasAvailabilities(for: dateComponents) } -
9:07 - Configure UICalendarView decorations.
// Configuring Decorations func calendarView( _ calendarView: UICalendarView, decorationFor dateComponents: DateComponents ) -> UICalendarView.Decoration? { switch myDatabase.eventType(on: dateComponents) { case .none: return nil case .busy: return .default() case .travel: return .image(airplaneImage, color: .systemOrange) case .party: return .customView { MyPartyEmojiLabel() } } } -
10:16 - Setting up a vertical UIPageControl with custom indicators
// Vertical page control with custom indicators pageControl.direction = .topToBottom pageControl.preferredIndicatorImage = UIImage(systemNamed: "square") pageControl.preferredCurrentIndicatorImage = UIImage(systemNamed: "square.fill") -
12:21 - Creating a custom sheet detent
// Create a custom detent sheet.detents = [ .large(), .custom { _ in 200.0 } ] -
12:38 - Creating a custom sheet detent using a percentage of maximum detent height
// Create a custom detent sheet.detents = [ .large(), .custom { context in 0.3 * context.maximumDetentValue } ] -
12:42 - Assigning identifiers to custom sheet detents
// Define a custom identifier extension UISheetPresentationController.Detent.Identifier { static let small = UISheetPresentationController.Detent.Identifier("small") } // Assign identifier to custom detent sheet.detents = [ .large(), .custom (identifier: .small) { context in 0.3 * context.maximumDetentValue } ] // Disable dimming above the custom detent sheet.largestUndimmedDetentIdentifier = .small -
22:16 - UIHostingConfiguration example
cell.contentConfiguration = UIHostingConfiguration { VStack { Image(systemName: "wand.and.stars") .font(.title) Text("Like magic!") .font(.title2).bold() } .foregroundStyle(Color.purple) }
-