Camera

The camera module helps to make camera app development easier, It provides consistency and an easy-to-use API for capturing images, videos and storing them.

Primary Use Cases

It improves the developer experience in several key ways.

  • Handle the entire process of capturing and storing so that the developer focus more on the coding part

  • Giving more control over the camera by changing some parameters, even control over orientation

  • Support multiple captures of photos and video in a single time

Ease of use

It allows you to focus on the task you need to get done instead of managing device-specific nuances. Most common camera use cases are supported:

  • Image Capture: Save the Image

  • Video Capture: Save video and audio

Adding Module

Add a dependency for the core module in Swift Package Manager get latest version.

https://github.com/Truvideo/truvideo-sdk-ios-camera.git

To add a dependency for the core module in Swift Package Manager, follow these steps:

  1. Open your Xcode project.

  2. Navigate to the "File" menu and select "Swift Packages" -> "Add Package Dependency..."

  3. In the dialog that appears, enter the URL of the package repository containing the core module.

  4. In the next step, you'll be prompted to choose the version, branch, or commit of the package you want to use. Select the appropriate option and click "Next."

  5. Xcode will then resolve the package and its dependencies.

  6. In the "Add package product to your App" dialog, make sure that the core module is selected and added to your app's target.

  7. Click on the "Finish" button to add the dependency.

For detailed instructions, you can refer to the Swift Package Manager documentation provided by Apple here.

Required permissions

For accessing the camera and microphone in the iOS app, you have to include some of the necessary permissions in your Info.plist file. Here are the basic steps:

  1. Open your Xcode project.

  2. Locate the Info.plist file in the Project Navigator.

  3. Right-click on the Info.plist file and select "Open As" > "Source Code".

  4. Add the following keys and descriptions inside the <dict> tag:

<key>NSCameraUsageDescription</key>
<string>We need access to your camera to capture photos.</string>
<key>NSMicrophoneUsageDescription</key>
<string>We need access to your microphone to record audio.</string>
  1. Save the Info.plist file and switch back to the standard editor view if necessary.

For detailed instructions, you can refer to Apple's official documentation “Requesting authorization to capture and save media“ here.

Last updated

Was this helpful?