Logo

Download
Swift/ObjC installation

Installing Themis for iOS and macOS #

Themis can be installed with SPM, CocoaPods and Carthage. Usually you want to install the stable package to benefit from automatic dependency management and security updates.

It is also possible to build the latest version of Themis from source, but it is highly non-trivial. Please drop us an email if you need assistance.

Installing with SPM #

Themis is available via SPM (Swift Package Manager).

Use the repository link:

https://github.com/cossacklabs/themis

Here are examples of SPM projects with Themis in Swift and Objective-C.

Installing with CocoaPods #

Use Themis version 0.13.10 or newer for full Apple Silicon support.

Themis is available via CocoaPods.

  1. Add the following line to your Podfile:

    pod 'themis'
    
  2. Install Themis pod:

    pod install
    

Here are examples of CocoaPods projects with Themis in Swift and Objective-C. These example projects are updated for Xcode 12.

Using BoringSSL #

themis-boringssl subspec is deprecated and will be removed in Themis 0.14. Please switch to the default subspec by using pod 'themis' in your Podfile.

By default, Themis uses OpenSSL as its crypto-engine.

If your project uses BoringSSL or gRPC libraries, you might want to switch to BoringSSL crypto-engine for Themis. Currently, BoringSSL is only available via CocoaPods:

pod 'themis/themis-boringssl'
Unfortunately, BoringSSL for iOS doesn’t support bitcode, so Themis with BoringSSL also doesn’t support bitcode :( Please disable bitcode for your application before archiving it to App Store, and everything will be fine.

Using OpenSSL Alternative #

themis-openssl subspec based on GRKOpenSSLFramework is deprecated and will be removed in Themis version 0.14. Please switch to the default subspec by using pod 'themis' in your Podfile.

Installing with Carthage #

Xcode 12 has introduced Apple Silicon support on macOS. Since 0.13.9 Themis uses XCFrameworks to support ARM64 architecture on macOS and ARM64-iphonesimulator architecture slice for iOS. First support of Apple Silicon was introduced in 0.13.4, but excluded ARM64-iphonesimulator architecture slice for iOS.

The required Carthage version to build Themis XCFramework is 0.38.0. You can continue using previous Carthage version with older Themis version where ARM64-iphonesimulator architecture slice is excluded.

Themis is also available via Carthage.

  1. Add the following line to your Cartfile:

    github "cossacklabs/themis"
    
  2. Download and build Themis:

    carthage update --use-xcframeworks
    
  3. Integrate themis.xcframework into your project according to Carthage instructions.

    You should drag&drop only themis.xcframework into your applications from Cartage/Build/themis.xcframework. Do not add openssl.xcframework manually from Cartage/Build/themis.xcframework, as it is statically linked with Themis (Carthage handles linking.).

Here are examples of Carthage projects with Themis in Swift and Objective-C. These example projects are updated for Xcode 12.