Skip to content

Run sample apps (iOS) ​

Foxit PDF SDK for iOS includes several sample apps (demos) to help you learn API usage and integration patterns. All demos are available in Objective-C and Swift; Swift samples are under samples/swift.

Before running samples, install:

  • Xcode
  • An iOS Simulator or a physical device

INFO

This guide does not cover Xcode installation. See Apple’s developer documentation if needed.

Sample overview ​

Foxit PDF SDK for iOS provides three types of samples:

Demo typeDescription
Function DemoDemonstrates basic PDF Core API calls
Viewer Control DemoDemonstrates reader features at the View Control layer
Complete PDF Viewer DemoA full PDF reader close to a production app

NOTE

  • The Swift Complete PDF Viewer Demo supports multi-document tabbed reading
  • Mac Catalyst only includes the Complete PDF Viewer Demo (Objective-C)

Common run steps ​

These steps apply to most iOS demos unless noted otherwise:

  1. In samples, double-click the .xcodeproj to open the demo.
    • Objective-C: samples/function_demo/function_demo.xcodeproj
    • Swift: samples/swift/function_demo_swift/function_demo_swift.xcodeproj
  2. Select an iOS Simulator or device as the run destination.
  3. Choose Product → Run.

NOTE

You can open samples/samples_xcworkspace, which contains all sample projects.

Function Demo ​

The Function Demo shows how to use the PDF Core API of Foxit PDF SDK for iOS for individual PDF features—useful for exploring specific APIs.

Sample features include:

  • pdf2txt — Export PDF content to a TXT file
  • outline — Edit outline titles and display styles
  • annotation — Add annotations and export to JSON
  • docinfo — Export basic document information
  • render — Render a page to a bitmap
  • signature — Add signatures, sign PDFs, and verify signatures
  • image2pdf — Convert images to PDF
  • watermark — Add text, image, or PDF page watermarks
  • search — Search text in a PDF
  • graphics_objects — Create a PDF with graphics objects

After a successful run, the app lists feature entries; tap a button to run the corresponding action.

Viewer Control Demo ​

The Viewer Control Demo shows typical PDF reader features provided by Foxit PDF SDK at the View Control layer—useful if you build your own reader UI.

Demonstrated features:

  • Text search
  • Outline (bookmarks)
  • Reading bookmarks
  • Annotations (highlight, underline, strikeout, typewriter, etc.)
  • Digital signatures

The demo structure makes it easy to locate common reader feature implementations.

NOTE

  • Outline is a PDF specification term; it corresponds to “bookmarks” in many readers
  • Reading bookmarks are application-level markers, not stored in the PDF file

Complete PDF Viewer Demo ​

The Complete PDF Viewer Demo is a full-featured PDF reader that integrates core capabilities and built-in UI from Foxit PDF SDK for iOS.

Without Mac Catalyst (iOS / iPadOS) ​

  • Objective-C and Swift supported
  • Swift version supports multi-document tabs

After launch, the home screen shows bundled samples:

  • Sample.pdf
  • complete_pdf_viewer_guide_ios.pdf

Use the switch control for multi-document tab mode to browse multiple PDFs.

NOTE

To test other PDFs, copy files to the device Documents directory.


With Mac Catalyst (macOS) ​

Foxit PDF SDK for iOS (Mac Catalyst) provides one Complete PDF Viewer Demo (Objective-C) for building an iPad app as a Mac app.

Requirements:

  • macOS 10.15 or later
  • Xcode 11 or later

Steps:

  1. Open samples/complete_pdf_viewer/complete_pdf_viewer.xcodeproj
  2. Set the run destination to My Mac
  3. Choose Product → Run

Features match the iOS version closely.

NOTE

Running the Mac Catalyst demo may require a provisioning profile that allows the app to run on Mac.