AppInfo.current provides read-only access to information about the currently running application, including its version, name, bundle identifier, build configuration, and platform details. It works consistently on both iOS and Android.
Debug build (DEBUG flag on iOS, FLAG_DEBUGGABLE on Android)
isRelease
Bool
Release build (inverse of isDebug)
isTestFlight
Bool
TestFlight install (iOS only, always false on Android)
osName
String
Platform name ("iOS", "Android", "macOS")
osVersion
String
OS version (e.g. "17.4.1" or "34" for API level)
deviceModel
String
Device model (e.g. "iPhone15,2", "Pixel 7")
minimumOSVersion
String?
Minimum required OS version
urlSchemes
[String]
Registered URL schemes (iOS only)
infoDictionaryKeys
[String]
All Info.plist keys (iOS only)
infoDictionaryValue(forKey:)
Any?
Raw Info.plist value lookup (iOS only)
Android implementation: Reads from PackageManager.getPackageInfo(), ApplicationInfo, and android.os.Build. The osVersion returns the SDK API level (e.g. "34" for Android 14). The isDebug flag checks ApplicationInfo.FLAG_DEBUGGABLE.
DeviceInfo.current provides information about the physical device, including screen dimensions, device type, battery status, network connectivity, and locale.
For live updates whenever connectivity changes, use monitorNetwork() which returns an AsyncStream<NetworkStatus>. The stream emits an initial value immediately and then a new value each time the network status changes:
struct ConnectivityView: View {
@Statevar status: NetworkStatus = .offline
var body: some View {
VStack {
Text("Network: \(status.rawValue)")
Circle()
.fill(status == .offline? Color.red: Color.green)
.frame(width: 20, height: 20)
}
.task {
forawait newStatus in DeviceInfo.current.monitorNetwork() {
status = newStatus
}
}
}
}
You can also use it in non-UI code:
funcwaitForConnectivity()async-> NetworkStatus {
forawait status in DeviceInfo.current.monitorNetwork() {
if status != .offline {
return status
}
}
return .offline
}
Cancel the monitoring by cancelling the enclosing Task:
let monitorTask =Task {
forawait status in DeviceInfo.current.monitorNetwork() {
print("Status changed: \(status.rawValue)")
}
}
// Later, stop monitoring:
monitorTask.cancel()
On iOS, monitorNetwork() uses NWPathMonitor for live path updates. On Android, it uses ConnectivityManager.registerDefaultNetworkCallback which receives onAvailable, onLost, and onCapabilitiesChanged callbacks. The callback is automatically unregistered when the stream is cancelled.
The View.withMediaPicker(type:isPresented:selectedImageURL:) extension function
can be used to enable the acquisition of an image from either the system camera
or the user’s media library.
On iOS, this camera selector will be presented in a fullScreenCover view,
whereas the media library browser will be presented in a sheet. In both cases,
a standad UIImagePickerController will be used to acquire the media.
On Android, the camera and library browser will be activated through
an Intent after querying for the necessary permissions.
Following is an example of implementing a media selection button that
will bring up the system user interface.
import SkipKit
/// A button that enables the selection of media from the library or the taking of a photo.
///
/// The selected/captured image will be communicated through the `selectedImageURL` binding,
/// which can be observed with `onChange` to perform an action when the media URL is acquired.
struct MediaButton : View {
let type: MediaPickerType // either .camera or .library
In order to access the device’s photos or media library, you will need to
declare the permissions in the app’s metadata.
On iOS this can be done by editing the Darwin/AppName.xcconfig file and adding the lines:
INFOPLIST_KEY_NSCameraUsageDescription = "This app needs to access the camera";
INFOPLIST_KEY_NSPhotoLibraryUsageDescription = "This app needs to access the photo library.";
On Android, the app/src/main/AndroidManifest.xml file will need to be edited to include
camera permissions as well as a FileProvider implementation so the camera can share a Uri with the app. For example:
In addition to editing the manifest, you must also manually create the xml/file_paths reference from the manifest’s provider. This is done by creating the folder Android/app/src/main/res/xml in your Skip project and adding a file file_paths.xml with the following contents:
<?xml version="1.0" encoding="utf-8"?>
<paths>
<external-pathname="my_images"path="." />
<cache-pathname="*"path="." />
</paths>
For an example of a properly configured project, see the Photo Chat sample application.
The View.withDocumentPicker(isPresented: Binding<Bool>, allowedContentTypes: [UTType], selectedDocumentURL: Binding<URL?>, selectedFilename: Binding<String?>, selectedFileMimeType: Binding<String?>) extension function can be used to select a document of the specified UTType from the device to use in the App.
On iOS it will use an instance of FileImporter to display the system file picker, essentially allowing to select a file from the Files application, while on Android it relies on the the system document picker via the Activity result for the ACTION_OPEN_DOCUMENT. Once the user selects a file it will receive an uri, that need to be parsed to be used outside the scope of the caller. For doing so it will copy the file inside the App cache folder and expose the cached url instead of the original picked file url.
On iOS, files selected through the system document picker are security-scoped — the app is only granted temporary access to read them. The withDocumentPicker modifier acquires and releases this access internally during the picker callback, but your onChange handler runs after the access has already been released. If you need to read or copy the file contents (e.g., importing it into your app’s documents directory), you must re-acquire access in your handler:
.withDocumentPicker(
isPresented: $showPicker,
allowedContentTypes: [.epub],
selectedDocumentURL: $pickedURL,
selectedFilename: $pickedName,
selectedFileMimeType: $pickedType
)
.onChange(of: pickedURL) { oldURL, newURL in
guardlet url = newURL else { return }
pickedURL =nil
Task {
#if !SKIP
// Re-acquire security-scoped access for the picked file.
// Without this, file operations like copy or read will fail
// with a "you don't have permission to view it" error.
let accessing = url.startAccessingSecurityScopedResource()
defer { if accessing { url.stopAccessingSecurityScopedResource() } }
#endif
awaitimportFile(from: url)
}
}
This is only needed on iOS — Android handles file access differently by copying the selected file to the app’s cache directory before returning the URL, so the #if !SKIP guard ensures the security-scoped calls are skipped on Android.
If you only need to display the file (e.g., pass it to a DocumentPreview) without reading its contents, re-acquiring access may not be necessary.
The View.withMailComposer() modifier presents a system email composition interface, allowing users to compose and send emails from within your app.
On iOS, this uses MFMailComposeViewController for in-app email composition with full support for recipients, subject, body (plain text or HTML), and file attachments. On Android, this launches an ACTION_SENDTO intent (or ACTION_SEND/ACTION_SEND_MULTIPLE when attachments are present), which opens the user’s preferred email app.
The View.withDocumentPreview(isPresented: Binding<Bool>, documentURL: URL?, filename: String?, type: String?) extension function can be used to preview a document available to the app (either selected with the provided Document Picker or downloaded locally by the App).
On iOS it will use an instance of QLPreviewController to display the file at the provided url while on Android it will open an Intent chooser for selecting the appropriate app for the provided file mime type.
On iOS there’s no need to provide a filename or a mime type, but sometimes on Android is necessary (for example when selecting a document using the document picker). On Android if no mime type is supplied it will try to guess it by the file url. If no mime type can be found the application chooser will be empty.
A file provider (like the one used for using the MediaPicker) is necessary for the Intent to correctly pass reading permission to the receiving app. As long as your Skip already implements the FileProvider and the file_paths.xml as described in the Camera and Media Permission section there’s nothing else needed, otherwise you need to follow the instructions in the mentioned section.
For cases where you want to display a web page without the full power and complexity of an embedded WebView (from SkipWeb), SkipKit provides the View.openWebBrowser() modifier. This opens a URL in the platform’s native in-app browser:
iOS: SFSafariViewController ↗ — a full-featured Safari experience presented within your app, complete with the address bar, share sheet, and reader mode.
Android: Chrome Custom Tabs ↗ — a Chrome-powered browsing experience that shares cookies, autofill, and saved passwords with the user’s browser.
By default the embedded browser slides up vertically as a modal sheet. Set presentationMode to .navigation for a horizontal slide transition that feels like a navigation push:
Button("Open with Navigation Style") {
showPage =true
}
.openWebBrowser(
isPresented: $showPage,
url: "https://skip.dev",
mode: .embeddedBrowser(params: EmbeddedParams(
presentationMode: .navigation
))
)
Mode
iOS
Android
.sheet (default)
Full-screen cover (slides up vertically)
Partial Custom Tabs ↗ bottom sheet (resizable, initially half-screen height). Falls back to full-screen if the browser does not support partial tabs.
.navigation
Navigation push (slides in horizontally)
Standard full-screen Chrome Custom Tabs launch
Limitations:
iOS: The .navigation presentation mode requires the calling view to be inside a NavigationStack (or NavigationView). If the view is not hosted in a navigation container, the modifier will have no effect.
Android: In .sheet mode, if the user’s browser does not support the Partial Custom Tabs API, the tab launches full-screen as a fallback.
Add custom actions that appear in the share sheet (iOS) or as menu items (Android):
Button("Open with Actions") {
showPage =true
}
.openWebBrowser(
isPresented: $showPage,
url: "https://skip.dev",
mode: .embeddedBrowser(params: EmbeddedParams(
customActions: [
WebBrowserAction(label: "Copy Link") { url in
// handle the action with the current page URL
},
WebBrowserAction(label: "Bookmark") { url in
// save the URL
}
]
))
)
On iOS, custom actions appear as UIActivity items in the Safari share sheet. On Android, they appear as menu items in Chrome Custom Tabs (maximum 5 items).
SkipKit provides a cross-platform haptic feedback API that works identically on iOS and Android. You define patterns using simple, platform-independent types, and SkipKit handles playback using CoreHaptics ↗ on iOS and VibrationEffect.Composition ↗ on Android.
Some patterns adjust based on parameters. The combo pattern escalates in intensity and length with higher streak counts, and finishes with a proportionally heavy thud:
// A 2x combo: two quick taps + light thud
HapticFeedback.play(.combo(streak: 2))
// A 5x combo: five escalating taps + heavy thud
HapticFeedback.play(.combo(streak: 5))
// Bouncing pattern with 4 taps of decreasing intensity
You can define your own patterns using HapticEvent and HapticPattern. Each event has a type, intensity (0.0 to 1.0), and delay in seconds relative to the previous event:
// A custom "power-up" pattern: rising buzz, pause, two sharp taps
On iOS, HapticFeedback uses a CHHapticEngine instance that is created on first use and restarted automatically if the system reclaims it. Each HapticPattern is converted to a CHHapticPattern with appropriate CHHapticEvent types and parameters. For more details, see Apple’s CoreHaptics documentation ↗.
On Android, patterns are converted to a VibrationEffect.Composition with the corresponding PRIMITIVE_* constants and played through the system Vibrator obtained from VibratorManager. For more details, see Android’s VibrationEffect documentation ↗ and the guide on custom haptic effects ↗.
SBOMView is a SwiftUI view that renders a “Software Bill of Materials” (SBOM)
screen for your app. It reads SPDX 2.3 JSON files generated by the
skip sbom create command and presents the bundled software dependencies as a
navigable list, with a detail view for each dependency that shows its license,
version, supplier, checksums, and any further packages it pulls in.
It is designed to be dropped straight into a Settings or Preferences screen via
a NavigationLink:
Use the skip sbom create command to produce the SPDX files and place them
inside the resources of the module that owns the SBOM screen (typically the
same module that exposes your app’s settings UI):
skip sbom create
The command produces both sbom-darwin-ios.spdx.json and
sbom-linux-android.spdx.json. Drop them into your module’s Resources/
directory and make sure your Package.swift target processes that
resources folder:
SBOMView supports two display modes via the SBOMDisplayMode enum:
.hierarchy(default) — Shows only the top-level dependencies (the
packages your app depends on directly), and lets the user drill into each
one to see its transitive dependencies. The hierarchy is reconstructed from
the DEPENDS_ON relationships in the SPDX document, so the screen mirrors
the actual dependency tree of your app.
.flat — Shows every package in the SBOM as a single alphabetised
list, regardless of where it sits in the dependency tree. This is useful
for audits, search-and-find workflows, or for showing a complete catalogue
of every binary that ends up in your app.
// Hierarchy view (the default): top-level deps only, drill in for transitives
NavigationLink("Bill of Materials") {
SBOMView(bundle: Bundle.module)
}
// Flat view: every package, sorted alphabetically
The summary list shows each dependency’s name, supplier, version, and
declared license. Tapping a row pushes a detail view that includes:
Package — name, version, supplier, originator, purpose, SPDX ID
License — declared and concluded licenses, copyright text, and a
“View License on spdx.org” button that opens the corresponding page on
spdx.org/licenses ↗ (e.g. tapping EUPL-1.2
opens https://spdx.org/licenses/EUPL-1.2.html) inside an in-app browser
(SFSafariViewController on iOS, Chrome Custom Tabs on Android). For
custom licenses identified by LicenseRef-…, the full license text and
any “see also” links are displayed inline from the SBOM’s
hasExtractedLicensingInfos section.
Dependencies — the direct sub-dependencies of this package, each as a
navigation link to its own detail view. This is what makes the hierarchy
view navigable: you start at your top-level deps and walk down through the
tree.
External References — purl, swiftpm, and other SPDX external refs
Checksums — SHA-1 / SHA-256 / etc. for each package archive
The summary list also includes a “Share Bill of Materials” button that
brings up the system share sheet so users (or auditors) can export the raw
SPDX JSON for offline review.
for dep in document.directDependencies(of: package) {
print(" └── \(dep.name??"?")")
}
}
}
The SPDXLicense helper provides utilities for working with SPDX license
identifiers, including extracting a canonical id from compound expressions
like LGPL-3.0-only WITH LGPL-3.0-linking-exception and constructing the
corresponding https://spdx.org/licenses/<id>.html URL:
SPDXLicense.licensePageURL(for: "EUPL-1.2")
// → https://spdx.org/licenses/EUPL-1.2.html
SPDXLicense.canonicalIdentifier("MIT OR Apache-2.0")
The module can be tested using the standard swift test command
or by running the test target for the macOS destination in Xcode,
which will run the Swift tests as well as the transpiled
Kotlin JUnit tests in the Robolectric Android simulation environment.
Parity testing can be performed with skip test,
which will output a table of the test results for both platforms.