Installation requirements
Both platforms have specific requirements for lottie-react-native
to be installed properly. Let's take a look now at what those differences are and how we can complete the installation in iOS and Android.
iOS devices
For its iOS version, lottie-react-native
depends on lottie-ios
, which is a library built by Airbnb in Swift. This means we need to enable our React Native app to read and execute Swift code. In order to do so, we need to create a bridging header (if we haven't done it yet) so the Objective-C part of our app can communicate with the Swift part and therefore, send and receive messages to lottie-ios
.
If we don't have a bridging header in our project, we can create one by following these steps:
- Open your
<project_name|/ios/<project_name|.xcworkspace
file in Xcode and go to File | New | File…:
- Select Swift...