React Nativeの対応が追いついてないNative機能を使うには、自分でブリッジを実装する必要がある。 ただ公式のDocsはほぼObj-Cのことしか書いてなくて、Swiftでもできるよ!って一言くらいしかない。 もちろん調べてもろくな例が出てこない! かといってObj-CよりSwiftの方が親しみやすい気がするなーということで・・・、四苦八苦しながらやり遂げたことをメモ。 アプリエンジニアではないので、非効率なコードや勘違いしてることを書いてる可能性もありです! 必要なファイル いちおうドキュメントはコレ。 Native Modules 基本的な流れはココに書いてあるけど、Swift版の端折られ感よ! 要約すると、 `XXX.swift`で実装する `XXX.m`でエクスポートする それらを認識させる`MyProject-Bridging-Header.h`を用意する この3つが必