How to Run a Demo
ComPDFKit PDF SDK for iOS provides multiple demos in Swift for developers to learn how to call the SDK on iOS. You can find them in the "Examples/Swift" folder.
In this guide, we take "PDFViewer-Swift" as an example to show how to run it in Xcode (The demo in Swift uses the "xcodeproj" method, so you can directly open "PDFViewer-Swift.xcodeproj").
Copy the "license_key_ios.xml" file, which will be used for local license or online license, into the "Examples" folder to replace (There is already a method to parse the xml file in demo, please do not modify the storage location and file name).
Find "PDFViewer-Swift.xcodeproj" in the "Examples/Swift" folder and double-click to open it, find the schemes of "PDFViewer-Swift" in Xcode, and select the corresponding simulator (ComPDFKit does not support the simulator to run M1 chip, but we have made it compatible in
Excluded Architectures
, you can see the processing method in Troubleshooting).
- Click Product -> Run to run the demo on an iOS device. In this guide, we use an iPhone 14 device as an example. After building the demo successfully, the "PDF32000_2008.pdf" file will be opened and displayed.
Note: This is a demo project, presenting completed ComPDFKit PDF SDK functions. The functions might be different based on the license you have purchased. Please check that the functions you choose work fine in this demo project.