Adding Flipper to iOS apps
We support both Swift and Objective-C for Flipper with CocoaPods as build and distribution mechanism.
CocoaPods
The following configuration assumed CocoaPods 1.9+.
For pure Objective-C projects
For pure Objective-C projects, add the following things in your settings:
/usr/lib/swift
as the first entry of theLD_RUNPATH_SEARCH_PATHS
- Add the following in
LIBRARY_SEARCH_PATHS
- If after the above two steps there are still error's like
Undefined symbol _swift_getFunctionReplacement
then setDEAD_CODE_STRIPPING
toYES
. Reference for this fix is here
This is done to overcome a bug with Xcode 11 which fails to compile swift code when bitcode is enabled. Flipper transitively depends on YogaKit which is written in Swift. More about this issue can be found here and here.
Install the dependencies by running pod install
. You can now import and initialize Flipper in your
AppDelegate.
- iOS
- Swift
Enabling plugins
Finally, you need to add plugins to your Flipper client. Above, we have only added the Layout Inspector plugin to get you started. See Network Plugin and Layout Inspector Plugin for information on how to add them, and also enable Litho or ComponentKit support. You can check the sample apps in the GitHub repo for examples of integrating other plugins.
Having trouble?
See the troubleshooting page for help with known problems.
On iOS, we currently do not support connecting to physical devices.