2025 DesignSwiftSwiftUI & UI FrameworksDeveloper Tools
WWDC25 · 37 min · Design / Swift / SwiftUI & UI Frameworks / Developer Tools
What’s new in Xcode 26
Discover the latest productivity and performance advancements in Xcode 26. Learn how to leverage large language models in your development workflow. Explore editing and debugging enhancements, improved performance and testing tools, and Swift Build - the open-source build system engine used by Xcode.
Watch at developer.apple.com ↗Chapters
Code shown on screen · 10 snippets
Using Playgrounds
import Playgrounds Using Playgrounds
#Playground {
} Using Playgrounds
let landmark = Landmark.exampleData.first Using Playgrounds
let region = landmark?.coordinateRegion Regex to scan for floating point numbers
func scanForFloatingPointNumbers() -> [Regex<Substring>.Match] {
return self.matches(of: /[0-9]*[.][0-9]+/)
} Adding another playground
#Playground {
} Adding another playground
let string = "lon: -113.16096, lat: 36.21904"
let longitude = string.scanForFloatingPointNumbers().first
let latitude = string.scanForFloatingPointNumbers().last Updated regular expression
func scanForFloatingPointNumbers() -> [Regex<Substring>.Match] {
return self.matches(of: /[+-]?[0-9]*[.][0-9]+/)
} Checking for camera authorization
// Checking for camera authorization
var isCameraAuthorized: Bool {
get async {
let status = AVCaptureDevice.authorizationStatus(for: .video)
// Determine if the user previously authorized camera access.
var isAuthorized = status == .authorized
// If the system hasn't determined the user's authorization status,
// explicitly prompt them for approval.
if status == .notDetermined {
isAuthorized = await AVCaptureDevice.requestAccess(for: .video)
}
return isAuthorized
}
} Test scrolling animation performance with XCTHitchMetric
// XCTHitchMetric
func testScrollingAnimationPerformance() throws {
// Custom performance test measure options.
let measureOptions = XCTMeasureOptions()
measureOptions.invocationOptions = .manuallyStop
// App being tested.
let app = XCUIApplication()
// Launch app and get reference to scroll view.
app.launch()
let scrollView = app.scrollViews.firstMatch
measure(metrics: [XCTHitchMetric(application: app)], options: measureOptions) {
scrollView.swipeUp(velocity: .fast)
stopMeasuring()
scrollView.swipeDown(velocity: .fast)
}
} Resources
Related sessions
-
12 min -
15 min -
22 min -
38 min -
33 min -
26 min -
36 min -
20 min -
15 min -
25 min