iOS Installation

Requirements

  • Minimum deployment target: iOS 12.0 or higher.
  • Xcode and CocoaPods must be installed on your development machine.
  • Supports both Intel and M1 (Apple Silicon) based machines.
  • On M1 (Apple Silicon) machines, some CocoaPods commands may need to be executed through Rosetta Stone compatibility mode.

Latest Stable Version

The current latest release of IDWise SDK.

SDK
IDWise 5.0.8

Integrating IDWise SDK via CocoaPods

IDWiseSDK can be installed using the CocoaPods package manager from the IDWise private CocoaPods repository. To integrate the IDWise SDK into your project, follow these steps:

  1. Ensure you have the following two lines at the top of your Podfile:

    source 'https://cdn.cocoapods.org/'
    source 'https://github.com/idwise/ios-sdk'
    

    These lines add the public CocoaPods source and the IDWise private repository as sources for package installation.

  2. Add the following line under the target section in your Podfile:

    pod 'IDWise'
    
  3. Additionally, include this configuration under the target section of your Podfile to handle code signing settings:

    post_install do |installer|
      installer.pods_project.build_configurations.each do |config|
        config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'
      end
    end
    
  4. After adding the dependency to your Podfile, run the following command in your terminal to install the IDWise SDK:

    pod install
    

Managing Device Orientation

IDWise SDK only supports portrait orientation for its screens. If your app supports multiple orientations, you can either lock your entire app to portrait mode or use the provided helper class to lock orientation for the IDWise SDK screens only, while maintaining other orientations elsewhere in your app.

  1. Add the following struct to your code
struct AppUtility {

    static func lockOrientation(_ orientation: UIInterfaceOrientationMask) {
    
        if let delegate = UIApplication.shared.delegate as? AppDelegate {
            delegate.orientationLock = orientation
        }
    }

    /// OPTIONAL Added method to adjust lock and rotate to the desired orientation
    static func lockOrientation(_ orientation: UIInterfaceOrientationMask, andRotateTo rotateOrientation:UIInterfaceOrientation) {
   
        self.lockOrientation(orientation)
    
        UIDevice.current.setValue(rotateOrientation.rawValue, forKey: "orientation")
        UINavigationController.attemptRotationToDeviceOrientation()
    }

}
  1. Update your AppDelegate.swift class

In your AppDelegate.swift, add the following code to manage the supported orientations:

// Set the default orientations allowed for your app
var orientationLock = UIInterfaceOrientationMask.all

func application(_ application: UIApplication, supportedInterfaceOrientationsFor window: UIWindow?) -> UIInterfaceOrientationMask {
  return self.orientationLock
} 
  1. Lock the orientation before starting the IDWise journey

Before initializing and starting the IDWise journey, lock the orientation to portrait using this code:

AppUtility.lockOrientation(.portrait)
  1. Unlock orientation after the IDWise journey is completed

Once the IDWise journey is finished or canceled, unlock the orientation to allow other orientations in your app again:

AppUtility.lockOrientation(.all)

This ensures that only the IDWise SDK screens are restricted to portrait mode, while the rest of your app can maintain its default orientation settings.