Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
The Aspose.BarCode Cloud SDK for Swift allows you to easily integrate barcode generation and recognition functionality into your Swift applications. This guide will walk you through the setup process using the GitHub repository and Swift Package Manager or CocoaPods .
You can install the Aspose.BarCode Cloud SDK via Swift Package Manager or CocoaPods:
The AsposeBarcodeCloud pod is not published to the CocoaPods trunk repository yet, so use Swift Package Manager until it becomes available. For CocoaPods, add the pod to your Podfile:
pod 'AsposeBarcodeCloud', '~> 26.9'
For Swift Package Manager, add the package dependency to Package.swift:
.package(url: "https://github.com/aspose-barcode-cloud/Aspose.BarCode-Cloud-SDK-for-Swift.git", from: "26.9.0")
The AsposeBarcodeCloudClient class is essential for setting up the SDK. It manages your API credentials, base URLs, and other settings.
First, import the required namespaces:
import AsposeBarcodeCloud
Then, set up the configuration:
let client = AsposeBarcodeCloudClient(
clientId: "<Your-Client-Id>",
clientSecret: "<Your-Client-Secret>"
)
This basic setup will use the default values for API base url, token url and other options which are optimized for general use.
Once configured, pass the configuration object to initialize API clients. Here’s an example:
let imageData = try await GenerateAPI.generate(
barcodeType: .qr,
data: "Aspose.BarCode Cloud",
barcodeImageParams: BarcodeImageParams(imageFormat: .png),
apiConfiguration: client.apiConfiguration
)
Now you can call SDK functions.
This documentation has provided the necessary steps to configure and initialize the Aspose.BarCode Cloud SDK for Swift. Refer to the other sections of the Developer Guide for more detailed usage examples.
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.