If you are reading this tutorial please be aware that this is for advanced users that require a singleton pattern in their RN native module and some documentation detail is left out intentionally.
For the sake of this tutorial we will be using TestManager
as our class.
- First of all you need to setup a swift class with a bridging header, in Xcode it will generate this for you upon creating a Swift file.
- Create your swift class with the @objc directive.
- Create a second class that has a static export of the class in singleton.
- Follow the files below for a boilerplat example.