The main life cycle we need to implement is - (void)layoutSubviews. Life Cycles/Initializer in the Objective C World This is what will be instantiated and hook into some lifecycle events so you can manipulate the Objective-C world.Įach View will need to do different things during these lifecycle events, it's up to you to implement them and figure out what exactly needs to be handled for the component that you are bridging. The Manager is also where we setup the module bridge, and declare what sort of properties we need, event callbacks, and additional constants to export if we need any. In our case we have an RNFLAnimatedImageManager that when asked will create an RNFLAnimateImage which will create and setup our FLAnimatedImage Objective-C component. It's essentially a singleton (there is just one of them) that when asked will produce a new view to use of whatever kind you define. The Manager is the orchestrator of this particular view we are bridging. You can read about linking libraries here. You then go through the usual process of adding a library to an XCode project. I essentially cloned the repo, and copied over the necessary files. We'll get into this when the tutorial actually starts. We have a few different choices, using pods?, using Carthage?, or just copy and pasting.įor the sake of this we're going to copy and paste. In our case we are depending on the FLAnimatedImage library. Save that somewhere and call it RNFLAnimatedImage so that you can follow along with the tutorial. In XCode go to File > New > Project and select Static Library I already did that, so we'll just focus on the real process. I tend to like to make my component as an application first and then I'll bust it out into a separate component.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |