# TIP: Use iOS CocoaPods Dependencies in Native Code

DevFeed: [TIP: Use iOS CocoaPods Dependencies in Native Code](<https://devfeed.tech/articles/tip-use-ios-cocoapods-dependencies-in-native-code-19606.md>)

Original publisher: [Read original article](<https://www.codenameone.com/blog/tip-use-ios-cocoapods-dependencies-native-code/>)

Author: Shai Almog

Published: 2017-02-12T00:00:00Z

Content type: tutorial

Language: en

Sources: [CodeName One](<https://devfeed.tech/sources/codename-one.md>)

Topics: [iOS](<https://devfeed.tech/topics/ios.md>), [Library](<https://devfeed.tech/topics/library.md>), [Gradle](<https://devfeed.tech/topics/gradle.md>)

Tags: [cocoapods](<https://devfeed.tech/tags/cocoapods.md>), [dependencies](<https://devfeed.tech/tags/dependencies.md>), [gradle](<https://devfeed.tech/tags/gradle.md>), [ios](<https://devfeed.tech/tags/ios.md>), [library](<https://devfeed.tech/tags/library.md>), [native](<https://devfeed.tech/tags/native.md>), [swift](<https://devfeed.tech/tags/swift.md>), [swift-package](<https://devfeed.tech/tags/swift-package.md>), [swift-package-manager](<https://devfeed.tech/tags/swift-package-manager.md>)

## AI overview

A Codename One tutorial explains how to use iOS CocoaPods dependencies with native code. It covers adding native libraries, the iOS deployment-target caveat for Intercom, and the build hint needed to target iOS 8 or newer. An editor note says Swift Package Manager is also supported in the current setup.

## Source excerpt

Editor note: This post is still valid for CocoaPods, but current iOS dependency setup also supports Swift Package Manager (SPM). See the current "Working with iOS" section in the developer guide. Last week I talked about using gradle dependencies to build native code, this week I'll talk about the iOS equivalent: CocoaPods. We've discussed CocoaPods before but this bears repeating especially in the context of a specific cn1lib like intercom. CocoaPods allow us to add a native library dependency to iOS far more easily than Gradle. However, I did run into a caveat with target OS versioning. By default we target iOS 7.0 or newer which is supported by Intercom only for older versions of the library. Annoyingly CocoaPods seemed to work, to solve this we had to explicitly define the build hint ios.pods.platform=8.0 to force iOS 8 or newer.