How do I to add a document scanner into my app?
Asked on 2024-07-17
1 search
To add a document scanner to your app, you can leverage the capabilities discussed in the WWDC sessions. Here are some steps and relevant information to help you get started:
-
Use the Camera for Capturing Documents:
- You can create a camera capture experience using the new framework introduced in iOS 18, which allows you to build a capture experience that runs from the lock screen. This is detailed in the session Build a great Lock Screen camera capture experience.
-
Implementing the Capture Extension:
- Define your extension to conform to the locked camera capture extension. This will allow you to create a consistent capture experience that can be accessed from the lock screen. More details can be found in the session Build a great Lock Screen camera capture experience.
-
Handling Permissions:
- Ensure that your extension and application include privacy usage descriptions for the camera. This is necessary for the system to display the description explaining why your app needs to use the camera. This is discussed in the session Build a great Lock Screen camera capture experience.
-
Working with Captured Content:
- After capturing the document, you can either add the photo and video assets directly to the user's photo library or store the data in a provided directory on the file system. For more in-depth interactions, such as sharing or applying filters, you can transition from the extension to the parent application. This is covered in the session Build a great Lock Screen camera capture experience.
-
Using Vision APIs for Document Scanning:
- Although not explicitly mentioned in the provided context, Apple’s Vision framework can be used to detect and recognize text in images, which is a common requirement for document scanning. You can integrate Vision APIs to enhance your document scanning capabilities.
For a more detailed guide, you can refer to the chapters in the session Build a great Lock Screen camera capture experience, especially the sections on the lifecycle of a capture extension and working with captures in your app.

Introducing enterprise APIs for visionOS
Find out how you can use new enterprise APIs for visionOS to create spatial experiences that enhance employee and customer productivity on Apple Vision Pro.

Build a great Lock Screen camera capture experience
Find out how the LockedCameraCapture API can help you bring your capture application’s most useful information directly to the Lock Screen. Examine the API’s features and functionality, learn how to get started creating a capture extension, and find out how that extension behaves when the device is locked.

Evolve your document launch experience
Make your document-based app stand out, and bring its unique identity into focus with the new document launch experience. Learn how to leverage the new API to customize the first screen people see when they launch your app. Utilize the new system-provided design, and amend it with custom actions, delightful decorative views, and impressive animations.
