hello, this is a helper library, and doesn’t really do anything on it’s own. This library is meant to be used as a dependency for some other libraries i am making — i.e. as a way to share code, and prevent duplicated logic.
Please see the version compatibility table for reference.
This library is being re-written to support both the new + old architecture. Please see this is issue for progress 😔
Overview:
-
RNIBaseView
: A shared/common “base view” to allow for making native components that work on both fabric (the new architecture) and paper (please see:RNIWrapperView
for an example implementation). -
RNIContentViewDelegate
: A delegate that let’s the conformingUIView
(written in swift) to manage + communicate with its associated parent fabric/paper view, and handle layout, receive props + async view commands from JS, and dispatch events from native. -
RNIViewLifecyleEvent
: a set of delegates for receiving common view lifecycle events between fabric + paper, as well as receiving events that are either fabric-only or paper-only. Please seeRNIBaseViewEventBroadcaster
for an overview of what events are supported. -
RNIContentViewParentDelegate
: Exposes useful properties and methods from the parent paper/fabric view (e.g. controlling size/layout, getting the layout metrics, etc). -
RNIBaseViewController
: A base implementation of a view controller that wraps a paper/fabric view and handles its sizing + layout when attached to non-react view. -
RNIUtilitiesModule
: A helper JSI module that allows for sharing sync data between swift and js, and sending async commands to either views that conform toRNIContentViewDelegate
, or objects that conform toRNIModuleCommandRequestHandling
(please see the js + swift impl. ofRNIDummyTestViewModule
for a crude example). -
Types and Parsing: Contains typescript definitions for native types (e.g.
UIKit
,CoreGraphics
primitives, etc) so they can be represented in JS, as well as the associated code to parse them in native (e.g.InitializableFromDictionary
,InitializableFromString
, dictionary helpers, etc). -
Misc: Contains a bunch of helpers + extensions for working with RN across swift/objc/c++, and has a dependency to
DGSwiftUtilities
for more helpers + utilities written in swift.
Development and maintenance of this library was generously sponsored by beatgig from 11/15/2023
to 04/30/2024
at $1,535
/month (totaling ≈ $9,100
over the course of 6 months) 🥁🎸
The initial fabric rewrite (i.e. version 5.x
) was made possible through a generous $3,750
sponsorship by tamagui over the course of 4 months (from: 05/27/24
to 09/30/24
) 🐦✨
very special thanks to: junzhengca, brentvatne, expo, EvanBacon, corasan, lauridskern, ronintechnologies, gerzonc, and edencakir for becoming a monthly sponsor, and thank you fobos531 for being a one time sponsor 🥺 (if you have the means to do so, please considering sponsoring here)
Thank you very much for contributing to this library: SamuelScheit (pr-#6
), coolsoftwaretyler (pr-#11
), fobos531 (pr-#18
) 💫
npm install react-native-ios-utilities@next
cd ios && pod install
In your project's Podfile
, you can also explicitly set REACT_NATIVE_TARGET_VERSION
env. to your specific RN version (see code snippet below).
require 'json'
reactNativeVersion = '0.0.0'
begin
reactNativeVersion = `node --print "require('react-native/package.json').version"`
rescue
reactNativeVersion = '0.0.0'
end
reactNativeTargetVersion = reactNativeVersion.split('.')[1].to_i
ENV['REACT_NATIVE_TARGET_VERSION'] = reactNativeTargetVersion.to_s
The REACT_NATIVE_TARGET_VERSION
env. variable gets passed as a macro constant, and is used for conditional compilation (e.g. to fix code due to changes with the RN API).
Alternatively, you can just set RCT_NEW_ARCH_ENABLED
env. directly when you invoke pod install
(e.g. REACT_NATIVE_TARGET_VERSION=76 pod install
).
When you run pod install
, you should see the following output in the terminal:
react-native-ios-utilities
- reactNativeTargetVersion: 0.75.2
- reactNativeTargetVersionOverride: 76
- fabric_enabled: true
- linkage: static
Library Version | Child Libraries / Dependents |
---|---|
react-native-ios-utilities Version: 4.3.x |
react-native-ios-context-menu Version: 2.4.x react-native-text-input-wrapper Version: 0.1.x react-native-ios-adaptive-modal Version: 0.6.x |
react-native-ios-utilities Version: 4.4.x |
react-native-ios-context-menu Version: 2.5.x react-native-text-input-wrapper Version: 0.1.x react-native-ios-adaptive-modal Version: 0.7.x |
react-native-ios-utilities Version: 5.x |
react-native-ios-context-menu Version: 3.x react-native-ios-visual-effect-view Version: 0.x react-native-ios-modal Version: 3.x |
See the contributing guide to learn how to contribute to the repository and the development workflow.
MIT