Contents

Technology-specific views

Use SwiftUI views that other Apple frameworks provide.

Overview

To access SwiftUI views that another framework defines, import both SwiftUI and the other framework into the file where you use the view. You can find the framework to import by looking at the availability information on the view’s documentation page.

[Image]

For example, to use the Map view in your app, import both SwiftUI and MapKit.

import SwiftUI
import MapKit

struct MyMapView: View {
    // Center the map on Joshua Tree National Park.
    var region = MKCoordinateRegion(
            center: CLLocationCoordinate2D(latitude: 34.011_286, longitude: -116.166_868),
            span: MKCoordinateSpan(latitudeDelta: 0.2, longitudeDelta: 0.2)
        )

    var body: some View {
        Map(initialPosition: .region(region))
    }
}

For design guidance, see Technologies in the Human Interface Guidelines.

Topics

Displaying web content

Accessing Apple Pay and Wallet

Authorizing and authenticating

Configuring Family Sharing

Reporting on device activity

Working with managed devices

Creating graphics

Getting location information

Displaying media

Supporting Group Activities

Selecting photos

Generating images

Previewing content

Interacting with networked devices

Configuring a Live Activity

Interacting with the App Store and Apple Music

Accessing health data

Providing tips

Showing a translation

Presenting journaling suggestions

Managing contact access

Syncing game saves

Handling game controller events

Creating a tabletop game

Configuring camera controls

Interacting with transactions

See Also

Framework integration