Skip to content

iTwin/mobile-sdk-ios

Repository files navigation

iTwin mobile-sdk-ios

Copyright © Bentley Systems, Incorporated. All rights reserved. See LICENSE.md for license terms and full copyright notice.

Warning

This is pre-release software and provided as-is.

About this Repository

This repository contains the Swift code used to build iTwin.js applications on iOS devices. This package requires iOS/iPadOS 13 or later.

Setup

This package is delivered as source-only and supports two options for dependency management.

Swift Package Manager

With Swift Package Manager, add https://github.com/iTwin/mobile-sdk-ios to your project's Package Dependencies settings in Xcode, making sure to set the "Dependency Rule" to "Exact Version" and the version to "0.22.15".

Or add the following package to your Package.swift dependencies:

dependencies: [
    .package(name: "itwin-mobile-sdk", url: "https://github.com/iTwin/mobile-sdk-ios", .exact("0.22.15"))
]

CocoaPods

With CocoaPods, add itwin-mobile-native, itwin-mobile-sdk, and AsyncLocationKit to your Podfile. Note: these are not hosted on the CocoaPods CDN so the correct URLs must be specified. Also, AsyncLocationKit does not have a podspec, so one is included as part of the mobile-sdk-ios release.

It is also necessary to disable bitcode for the itwin projects, which can be done via a post_install function.

project 'MyMobileApp.xcodeproj/'

# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

target 'MyMobileApp' do
  # Comment the next line if you don't want to use dynamic frameworks
  use_frameworks!

  # Pods for MyMobileApp
  pod 'itwin-mobile-native', podspec: 'https://github.com/iTwin/mobile-native-ios/releases/download/4.9.35/itwin-mobile-native-ios.podspec'
  pod 'itwin-mobile-sdk', podspec: 'https://github.com/iTwin/mobile-sdk-ios/releases/download/0.22.15/itwin-mobile-sdk.podspec'
  pod 'AsyncLocationKit', podspec: 'https://github.com/iTwin/mobile-sdk-ios/releases/download/0.22.15/AsyncLocationKit.podspec'
end

post_install do |installer|
  installer.generated_projects.each do |project|
    project.targets.each do |target|
      target.build_configurations.each do |config|
        # Disables bitcode for the itwin pods
        if target.name.start_with?("itwin-mobile-")
          config.build_settings['ENABLE_BITCODE'] = 'NO'
        end
      end
    end
  end
end

Notes

  • This package is designed to be used with the @itwin/mobile-sdk-core and @itwin/mobile-ui-react packages. Those two packages are intended to be installed via npm, and their version number must match the version number of this package. Furthermore, they use iTwin.js 4.9.5, and your app must use that same version of iTwin.js.

  • If you are using this package via CocoaPods, make sure to set the itwin-mobile-native CocoaPod to version 4.9.35

  • You may get a warning from AppAuth's OIDExternalUserAgentIOS.h when you build any project that includes this as a Swift Package. Unfortunately, there is no way that we know of to disable that warning. It can be ignored, though.