In iOS, developers have the option to develop in either Objective-C, which supports most iOS versions, and Swift, which is becoming more widely used in iOS development. While the Swrve iOS SDK includes a number of Objective-C files, Apple has made it easy to use both Swift and Objective-C in the same project.
For instructions on how to integrate the iOS SDK into a Swift project, see the iOS integration guide.
Manually including the SDK as part of your Project.
Using CocoaPods as the dependency manager.
The following sections describe issues that can occur in each combination and the workarounds available.
These are the most heavily tested and supported configurations in iOS. There are no integration issues at this time.
CocoaPods forces the use of frameworks with Swift. When using a framework, the bundle and other compilation properties default to the main project. As a result, when you reference assets or frameworks in your code, the compiler assumes it’s in the main bundle. Therefore, you need to ensure that the correct bundle is referenced when loading these assets.
The assets issue is fixed in iOS SDK 4.5.2. For more information, see the iOS SDK release notes.
There are no major integration issues if you add the SDK directly to your Swift project. However, if you add extra imports to the Bridging-Header.h file, the appropriate files aren’t added to the SwrveSDK.h file to enable calls to the Message Center SwrveBaseCampaign object. As a workaround, add #import SwrveBaseCampaign.h to the bridging header. This issue is fixed in iOS SDK 4.5.2. For more information, see the iOS SDK release notes.