react-native-screens 4.25.0-beta.1 → 4.25.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/src/main/java/com/swmansion/rnscreens/gamma/stack/header/StackHeaderAppBarLayout.kt +6 -14
- package/android/src/main/java/com/swmansion/rnscreens/gamma/stack/header/StackHeaderAppBarLayoutBehavior.kt +29 -0
- package/android/src/main/java/com/swmansion/rnscreens/gamma/stack/header/StackHeaderCoordinator.kt +56 -0
- package/android/src/main/java/com/swmansion/rnscreens/gamma/stack/header/config/StackHeaderConfig.kt +11 -0
- package/android/src/main/java/com/swmansion/rnscreens/gamma/stack/header/config/StackHeaderConfigProviding.kt +5 -0
- package/android/src/main/java/com/swmansion/rnscreens/gamma/stack/header/config/StackHeaderConfigViewManager.kt +35 -0
- package/android/src/main/java/com/swmansion/rnscreens/gamma/stack/header/subview/StackHeaderSubview.kt +3 -7
- package/android/src/main/java/com/swmansion/rnscreens/gamma/tabs/container/TabsActionOrigin.kt +26 -0
- package/android/src/main/java/com/swmansion/rnscreens/gamma/tabs/container/TabsContainer.kt +227 -151
- package/android/src/main/java/com/swmansion/rnscreens/gamma/tabs/container/TabsNavigationState.kt +60 -0
- package/android/src/main/java/com/swmansion/rnscreens/gamma/tabs/container/{TabsContainerDelegate.kt → TabsNavigationStateObserver.kt} +19 -14
- package/android/src/main/java/com/swmansion/rnscreens/gamma/tabs/container/TabsNavigationStateObserverRegistry.kt +88 -0
- package/android/src/main/java/com/swmansion/rnscreens/gamma/tabs/host/TabsHost.kt +40 -24
- package/android/src/main/java/com/swmansion/rnscreens/gamma/tabs/host/TabsHostEventEmitter.kt +11 -9
- package/android/src/main/java/com/swmansion/rnscreens/gamma/tabs/host/TabsHostViewManager.kt +19 -7
- package/android/src/main/java/com/swmansion/rnscreens/gamma/tabs/host/event/TabsHostTabSelectedEvent.kt +4 -3
- package/android/src/main/java/com/swmansion/rnscreens/gamma/tabs/host/event/TabsHostTabSelectionPreventedEvent.kt +3 -3
- package/android/src/main/java/com/swmansion/rnscreens/gamma/tabs/host/event/TabsHostTabSelectionRejectedEvent.kt +12 -11
- package/ios/conversion/RNSConversions-Tabs.mm +19 -0
- package/ios/conversion/RNSConversions.h +3 -0
- package/ios/tabs/bottom-accessory/RNSTabsBottomAccessoryHelper.mm +34 -5
- package/ios/tabs/host/RNSTabBarController.h +152 -99
- package/ios/tabs/host/RNSTabBarController.mm +137 -113
- package/ios/tabs/host/RNSTabsHostComponentView.h +7 -8
- package/ios/tabs/host/RNSTabsHostComponentView.mm +37 -33
- package/ios/tabs/host/RNSTabsHostEventEmitter.h +4 -4
- package/ios/tabs/host/RNSTabsHostEventEmitter.mm +5 -3
- package/ios/tabs/host/RNSTabsNavigationState.h +142 -27
- package/ios/tabs/host/RNSTabsNavigationState.mm +35 -2
- package/ios/tabs/host/RNSTabsNavigationStateObserverRegistry.h +62 -0
- package/ios/tabs/host/RNSTabsNavigationStateObserverRegistry.mm +104 -0
- package/lib/commonjs/components/gamma/stack/header/StackHeaderConfig.android.js +46 -1
- package/lib/commonjs/components/gamma/stack/header/StackHeaderConfig.android.js.map +1 -1
- package/lib/commonjs/components/safe-area/SafeAreaView.web.js +2 -3
- package/lib/commonjs/components/safe-area/SafeAreaView.web.js.map +1 -1
- package/lib/commonjs/components/tabs/host/TabsHost.android.js +2 -2
- package/lib/commonjs/components/tabs/host/TabsHost.android.js.map +1 -1
- package/lib/commonjs/components/tabs/host/TabsHost.ios.js +2 -2
- package/lib/commonjs/components/tabs/host/TabsHost.ios.js.map +1 -1
- package/lib/commonjs/fabric/gamma/stack/StackHeaderConfigAndroidNativeComponent.js.map +1 -1
- package/lib/commonjs/flags.js +1 -0
- package/lib/commonjs/flags.js.map +1 -1
- package/lib/module/components/gamma/stack/header/StackHeaderConfig.android.js +46 -1
- package/lib/module/components/gamma/stack/header/StackHeaderConfig.android.js.map +1 -1
- package/lib/module/components/safe-area/SafeAreaView.web.js +1 -1
- package/lib/module/components/safe-area/SafeAreaView.web.js.map +1 -1
- package/lib/module/components/tabs/host/TabsHost.android.js +2 -2
- package/lib/module/components/tabs/host/TabsHost.android.js.map +1 -1
- package/lib/module/components/tabs/host/TabsHost.ios.js +2 -2
- package/lib/module/components/tabs/host/TabsHost.ios.js.map +1 -1
- package/lib/module/fabric/gamma/stack/StackHeaderConfigAndroidNativeComponent.js.map +1 -1
- package/lib/module/flags.js +1 -0
- package/lib/module/flags.js.map +1 -1
- package/lib/typescript/components/gamma/split/SplitHost.types.d.ts +1 -1
- package/lib/typescript/components/gamma/split/SplitHost.types.d.ts.map +1 -1
- package/lib/typescript/components/gamma/stack/header/StackHeaderConfig.android.d.ts.map +1 -1
- package/lib/typescript/components/gamma/stack/header/StackHeaderConfig.android.types.d.ts +183 -8
- package/lib/typescript/components/gamma/stack/header/StackHeaderConfig.android.types.d.ts.map +1 -1
- package/lib/typescript/components/gamma/stack/header/StackHeaderConfig.types.d.ts +37 -0
- package/lib/typescript/components/gamma/stack/header/StackHeaderConfig.types.d.ts.map +1 -1
- package/lib/typescript/components/gamma/stack/header/android/StackHeaderSubview.android.types.d.ts +1 -1
- package/lib/typescript/components/gamma/stack/header/android/StackHeaderSubview.android.types.d.ts.map +1 -1
- package/lib/typescript/components/gamma/stack/host/StackHost.types.d.ts +1 -1
- package/lib/typescript/components/gamma/stack/host/StackHost.types.d.ts.map +1 -1
- package/lib/typescript/components/safe-area/SafeAreaView.web.d.ts +1 -1
- package/lib/typescript/components/safe-area/SafeAreaView.web.d.ts.map +1 -1
- package/lib/typescript/components/tabs/host/TabsHost.types.d.ts +29 -19
- package/lib/typescript/components/tabs/host/TabsHost.types.d.ts.map +1 -1
- package/lib/typescript/components/tabs/index.d.ts +1 -1
- package/lib/typescript/components/tabs/index.d.ts.map +1 -1
- package/lib/typescript/fabric/gamma/stack/StackHeaderConfigAndroidNativeComponent.d.ts +5 -0
- package/lib/typescript/fabric/gamma/stack/StackHeaderConfigAndroidNativeComponent.d.ts.map +1 -1
- package/lib/typescript/fabric/tabs/TabsHostAndroidNativeComponent.d.ts +5 -5
- package/lib/typescript/fabric/tabs/TabsHostAndroidNativeComponent.d.ts.map +1 -1
- package/lib/typescript/fabric/tabs/TabsHostIOSNativeComponent.d.ts +5 -5
- package/lib/typescript/fabric/tabs/TabsHostIOSNativeComponent.d.ts.map +1 -1
- package/lib/typescript/flags.d.ts +1 -0
- package/lib/typescript/flags.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/gamma/split/SplitHost.types.ts +1 -1
- package/src/components/gamma/stack/header/StackHeaderConfig.android.tsx +72 -2
- package/src/components/gamma/stack/header/StackHeaderConfig.android.types.ts +183 -8
- package/src/components/gamma/stack/header/StackHeaderConfig.types.ts +37 -0
- package/src/components/gamma/stack/header/android/StackHeaderSubview.android.types.ts +1 -1
- package/src/components/gamma/stack/host/StackHost.types.ts +1 -1
- package/src/components/safe-area/SafeAreaView.web.tsx +1 -1
- package/src/components/tabs/host/TabsHost.android.tsx +2 -2
- package/src/components/tabs/host/TabsHost.ios.tsx +2 -2
- package/src/components/tabs/host/TabsHost.types.ts +29 -19
- package/src/components/tabs/index.ts +1 -1
- package/src/fabric/gamma/stack/StackHeaderConfigAndroidNativeComponent.ts +6 -0
- package/src/fabric/tabs/TabsHostAndroidNativeComponent.ts +5 -5
- package/src/fabric/tabs/TabsHostIOSNativeComponent.ts +5 -5
- package/src/flags.ts +1 -0
- package/android/src/main/java/com/swmansion/rnscreens/gamma/tabs/container/TabsContainerOps.kt +0 -7
- package/android/src/main/java/com/swmansion/rnscreens/gamma/tabs/container/TabsNavState.kt +0 -43
|
@@ -14,26 +14,6 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
14
14
|
@class RNSTabsHostComponentView;
|
|
15
15
|
@class RNSTabBarController;
|
|
16
16
|
|
|
17
|
-
@protocol RNSTabBarControllerDelegate <NSObject>
|
|
18
|
-
|
|
19
|
-
- (void)tabBarController:(nonnull RNSTabBarController *)tabBarController
|
|
20
|
-
didUpdateStateTo:(nonnull RNSTabsNavigationState *)navState
|
|
21
|
-
withContext:(nonnull RNSTabsNavigationStateUpdateContext *)context;
|
|
22
|
-
|
|
23
|
-
- (void)tabBarController:(nonnull RNSTabBarController *)tabBarController
|
|
24
|
-
rejectedStateUpdateTo:(nonnull RNSTabsNavigationState *)rejectedNavState
|
|
25
|
-
currentState:(nonnull RNSTabsNavigationState *)currentNavState
|
|
26
|
-
withReason:(RNSTabsNavigationStateRejectionReason)reasonCode;
|
|
27
|
-
|
|
28
|
-
- (void)tabBarController:(nonnull RNSTabBarController *)tabBarController
|
|
29
|
-
preventedSelectionOf:(nonnull NSString *)screenKey
|
|
30
|
-
currentState:(nonnull RNSTabsNavigationState *)currentNavState;
|
|
31
|
-
|
|
32
|
-
- (void)tabBarController:(nonnull RNSTabBarController *)tabBarController
|
|
33
|
-
didSelectMoreTabWithCurrentState:(nonnull RNSTabsNavigationState *)currentNavState;
|
|
34
|
-
|
|
35
|
-
@end
|
|
36
|
-
|
|
37
17
|
@protocol RNSReactTransactionObserving
|
|
38
18
|
|
|
39
19
|
- (void)reactMountingTransactionWillMount;
|
|
@@ -43,21 +23,87 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
43
23
|
@end
|
|
44
24
|
|
|
45
25
|
/**
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
26
|
+
* UITabBarController subclass that backs `<TabsHost>` on iOS.
|
|
27
|
+
*
|
|
28
|
+
* This controller is responsible for tab management & all other responsibilities coming from the
|
|
29
|
+
* fact of inheritance from `UITabBarController`. It is limited only to the child view controllers
|
|
30
|
+
* of type `RNSTabsScreenViewController`, however.
|
|
49
31
|
*
|
|
50
32
|
* Updates made by this controller are synchronized by `RNSReactTransactionObserving` protocol,
|
|
51
|
-
* i.e. if you made changes through one of signals method, unless you flush them immediately
|
|
52
|
-
* be executed only after react finishes the transaction (from within transaction execution
|
|
33
|
+
* i.e. if you made changes through one of signals method, unless you flush them immediately, they
|
|
34
|
+
* will be executed only after react finishes the transaction (from within transaction execution
|
|
35
|
+
* block).
|
|
36
|
+
*
|
|
37
|
+
* # Public API
|
|
38
|
+
*
|
|
39
|
+
* Methods and properties under `#pragma mark - Public API` below are the only contract
|
|
40
|
+
* third-party native consumers should rely on:
|
|
41
|
+
* - read the current navigation state via `navigationState`,
|
|
42
|
+
* - request a tab change via `submitSelectionOfTabsScreenWithKey:` (transition is recorded with
|
|
43
|
+
* `RNSTabsActionOriginProgrammaticNative`),
|
|
44
|
+
* - apply pending updates via `flushPendingUpdates`,
|
|
45
|
+
* - observe results via `addNavigationStateObserver:` / `removeNavigationStateObserver:`
|
|
46
|
+
* (see `RNSTabsNavigationStateObserver` in `RNSTabsNavigationState.h`).
|
|
47
|
+
*
|
|
48
|
+
* # Internal API
|
|
49
|
+
*
|
|
50
|
+
* Members under `#pragma mark - Internal API` are host-only (`RNSTabsHostComponentView`)
|
|
51
|
+
* implementation detail and may change without notice. Do not call from third-party code.
|
|
53
52
|
*/
|
|
54
|
-
@interface RNSTabBarController : UITabBarController <
|
|
55
|
-
RNSReactTransactionObserving
|
|
53
|
+
@interface RNSTabBarController : UITabBarController <RNSReactTransactionObserving
|
|
56
54
|
#if !TARGET_OS_TV
|
|
57
|
-
|
|
58
|
-
|
|
55
|
+
,
|
|
56
|
+
RNSOrientationProviding
|
|
59
57
|
#endif // !TARGET_OS_TV
|
|
60
|
-
|
|
58
|
+
>
|
|
59
|
+
|
|
60
|
+
#pragma mark - Public API
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Represents current navigation state.
|
|
64
|
+
*
|
|
65
|
+
* After each model update, the container (controller) updates the navigation state. The
|
|
66
|
+
* `provenance` part is incremented monotonically with each state update.
|
|
67
|
+
*
|
|
68
|
+
* The controller manages this state. It MUST NOT be overwritten by any external actor.
|
|
69
|
+
*/
|
|
70
|
+
@property (nonatomic, readonly, strong, nullable) RNSTabsNavigationState *navigationState;
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Request a tab change. The transition is recorded with `RNSTabsActionOriginProgrammaticNative`,
|
|
74
|
+
* and is built against the current `navigationState.provenance` so it is never treated as stale.
|
|
75
|
+
*
|
|
76
|
+
* The update is applied on the next `RNSReactTransactionObserving` callback, or call
|
|
77
|
+
* `flushPendingUpdates` to apply it immediately. If you want to execute multiple updates in
|
|
78
|
+
* sequence you must flush the container after each one separately.
|
|
79
|
+
*/
|
|
80
|
+
- (void)submitSelectionOfTabsScreenWithKey:(nonnull NSString *)screenKey;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Apply any pending invalidations and state updates in a single coordinated pass.
|
|
84
|
+
* No-op when nothing is dirty.
|
|
85
|
+
*/
|
|
86
|
+
- (void)flushPendingUpdates;
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Register an observer for navigation state events on this container.
|
|
90
|
+
* Observers are held strongly; call `removeNavigationStateObserver:` before observer
|
|
91
|
+
* dealloc, or rely on the host calling `tearDown` on container teardown.
|
|
92
|
+
*
|
|
93
|
+
* Returns NO if the observer is already registered or if called from within an
|
|
94
|
+
* observer callback (modifications during emission are rejected).
|
|
95
|
+
*/
|
|
96
|
+
- (BOOL)addNavigationStateObserver:(id<RNSTabsNavigationStateObserver>)observer;
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Unregister a previously registered observer.
|
|
100
|
+
*
|
|
101
|
+
* Returns NO if the observer was not registered or if called from within an
|
|
102
|
+
* observer callback (modifications during emission are rejected).
|
|
103
|
+
*/
|
|
104
|
+
- (BOOL)removeNavigationStateObserver:(id<RNSTabsNavigationStateObserver>)observer;
|
|
105
|
+
|
|
106
|
+
#pragma mark - Internal API (host-only; subject to change without notice)
|
|
61
107
|
|
|
62
108
|
- (instancetype)initWithTabsHostComponentView:(nullable RNSTabsHostComponentView *)tabsHostComponentView;
|
|
63
109
|
|
|
@@ -70,52 +116,75 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
70
116
|
@property (nonatomic, readonly, nullable) RNSTabsHostComponentView *tabsHostComponentView;
|
|
71
117
|
|
|
72
118
|
/**
|
|
73
|
-
* Tab bar appearance coordinator. If you need to update tab bar appearance avoid using this one
|
|
74
|
-
* controller a signal, invalidate the tab bar appearance & either wait for the
|
|
119
|
+
* Tab bar appearance coordinator. If you need to update tab bar appearance avoid using this one
|
|
120
|
+
* directly. Send the controller a signal, invalidate the tab bar appearance & either wait for the
|
|
121
|
+
* update flush or flush it manually.
|
|
75
122
|
*/
|
|
76
123
|
@property (nonatomic, readonly, strong, nonnull) RNSTabBarAppearanceCoordinator *tabBarAppearanceCoordinator;
|
|
77
124
|
|
|
78
125
|
/**
|
|
79
|
-
*
|
|
126
|
+
* If true, the controller will reject any navigation state updates if the provenance of the
|
|
127
|
+
* update is stale.
|
|
80
128
|
*
|
|
81
|
-
*
|
|
82
|
-
*
|
|
129
|
+
* A navigation state update is considered stale if its provenance is older than the provenance
|
|
130
|
+
* of the currently active navigation state.
|
|
83
131
|
*
|
|
84
|
-
*
|
|
132
|
+
* This can happen, e.g. when an update from JS is dispatched, but before it reaches the native
|
|
133
|
+
* side, another update happens on UI thread, e.g. user selects another tab. For such situations,
|
|
134
|
+
* where to-be-applied navigation state update had been dispatched w/o full context of actual
|
|
135
|
+
* navigation state you can toggle this prop.
|
|
136
|
+
*
|
|
137
|
+
* If an update is rejected due to being stale, the controller will notify its observers.
|
|
85
138
|
*/
|
|
86
|
-
@property (nonatomic,
|
|
139
|
+
@property (nonatomic, readwrite) BOOL rejectStaleNavigationStateUpdates;
|
|
87
140
|
|
|
88
141
|
/**
|
|
142
|
+
* Tell the controller that react provided tabs have changed (count / instances) & the child
|
|
143
|
+
* view controllers need to be updated.
|
|
89
144
|
*
|
|
90
|
-
*
|
|
91
|
-
*
|
|
145
|
+
* This also automatically raises `needsUpdateOfChildViewControllers` flag, no need to call it
|
|
146
|
+
* manually.
|
|
147
|
+
*/
|
|
148
|
+
- (void)childViewControllersHaveChangedTo:(nonnull NSArray<RNSTabsScreenViewController *> *)childViewControllers;
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Request navigation state update from the controller to the given one.
|
|
92
152
|
*
|
|
93
|
-
*
|
|
94
|
-
* than the provenance of the currently active navigation state.
|
|
153
|
+
* Pass nil to clear any queued update.
|
|
95
154
|
*
|
|
96
|
-
*
|
|
97
|
-
*
|
|
98
|
-
*
|
|
99
|
-
* full context of actual navigation state you can toggle this prop.
|
|
155
|
+
* The update is applied on the next `RNSReactTransactionObserving` callback, or call
|
|
156
|
+
* `flushPendingUpdates` to apply it immediately. If you want to execute multiple updates in
|
|
157
|
+
* sequence you must flush the container after each one separately.
|
|
100
158
|
*
|
|
101
|
-
*
|
|
159
|
+
* Host-only: third-party native consumers should use `submitSelectionOfTabsScreenWithKey:` instead, which
|
|
160
|
+
* forces `RNSTabsActionOriginProgrammaticNative`. This method allows the host to dispatch any
|
|
161
|
+
* origin (e.g. `RNSTabsActionOriginProgrammaticJs` for JS-driven `navStateRequest` updates).
|
|
102
162
|
*/
|
|
103
|
-
|
|
163
|
+
- (void)setPendingNavigationStateUpdate:(nullable RNSTabsNavigationStateUpdateRequest *)stateUpdate;
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Idempotent teardown. Releases observer references and any retained host references.
|
|
167
|
+
* Called by the host on view lifecycle end.
|
|
168
|
+
*/
|
|
169
|
+
- (void)tearDown;
|
|
170
|
+
|
|
171
|
+
#pragma mark Individual flush methods (internal)
|
|
104
172
|
|
|
105
173
|
/**
|
|
106
174
|
* Update tab controller state with previously provided children.
|
|
107
175
|
*
|
|
108
|
-
* This method does nothing if the children have not been changed / update has not been requested
|
|
109
|
-
* The requested update is performed immediately. If you do not need this, consider just
|
|
110
|
-
* invalidation signal & let the controller decide when to flush the
|
|
176
|
+
* This method does nothing if the children have not been changed / update has not been requested
|
|
177
|
+
* before. The requested update is performed immediately. If you do not need this, consider just
|
|
178
|
+
* raising an appropriate invalidation signal & let the controller decide when to flush the
|
|
179
|
+
* updates.
|
|
111
180
|
*/
|
|
112
181
|
- (void)updateChildViewControllersIfNeeded;
|
|
113
182
|
|
|
114
183
|
/**
|
|
115
184
|
* Force update of the tab controller state with previously provided children.
|
|
116
185
|
*
|
|
117
|
-
* The requested update is performed immediately. If you do not need this, consider just raising
|
|
118
|
-
* invalidation signal & let the controller decide when to flush the updates.
|
|
186
|
+
* The requested update is performed immediately. If you do not need this, consider just raising
|
|
187
|
+
* an appropriate invalidation signal & let the controller decide when to flush the updates.
|
|
119
188
|
*/
|
|
120
189
|
- (void)updateReactChildrenControllers;
|
|
121
190
|
|
|
@@ -123,8 +192,9 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
123
192
|
* If any state update operation is pending - perform it.
|
|
124
193
|
*
|
|
125
194
|
* This method does nothing if the update has not been previously requested.
|
|
126
|
-
* If needed, the requested update is performed immediately. If you do not need this, consider
|
|
127
|
-
* appropriate invalidation signal & let the controller decide when to flush the
|
|
195
|
+
* If needed, the requested update is performed immediately. If you do not need this, consider
|
|
196
|
+
* just raising an appropriate invalidation signal & let the controller decide when to flush the
|
|
197
|
+
* updates.
|
|
128
198
|
*/
|
|
129
199
|
- (void)updateSelectedViewControllerIfNeeded;
|
|
130
200
|
|
|
@@ -133,8 +203,8 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
133
203
|
*
|
|
134
204
|
* To request update use `setPendingNavigationStateUpdate`.
|
|
135
205
|
*
|
|
136
|
-
* The requested update is performed immediately. If you do not need this, consider just raising
|
|
137
|
-
* invalidation signal & let the controller decide when to flush the updates.
|
|
206
|
+
* The requested update is performed immediately. If you do not need this, consider just raising
|
|
207
|
+
* an appropriate invalidation signal & let the controller decide when to flush the updates.
|
|
138
208
|
*/
|
|
139
209
|
- (void)updateSelectedViewController;
|
|
140
210
|
|
|
@@ -142,16 +212,17 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
142
212
|
* Updates the tab bar appearance basing on configuration sources (host view, tab screens).
|
|
143
213
|
*
|
|
144
214
|
* This method does nothing if the update has not been previously requested.
|
|
145
|
-
* If needed, the requested update is performed immediately. If you do not need this, consider
|
|
146
|
-
* appropriate invalidation signal & let the controller decide when to flush the
|
|
215
|
+
* If needed, the requested update is performed immediately. If you do not need this, consider
|
|
216
|
+
* just raising an appropriate invalidation signal & let the controller decide when to flush the
|
|
217
|
+
* updates.
|
|
147
218
|
*/
|
|
148
219
|
- (void)updateTabBarAppearanceIfNeeded;
|
|
149
220
|
|
|
150
221
|
/**
|
|
151
222
|
* Updates the tab bar appearance basing on configuration sources (host view, tab screens).
|
|
152
223
|
*
|
|
153
|
-
* The requested update is performed immediately. If you do not need this, consider just raising
|
|
154
|
-
* invalidation signal & let the controller decide when to flush the updates.
|
|
224
|
+
* The requested update is performed immediately. If you do not need this, consider just raising
|
|
225
|
+
* an appropriate invalidation signal & let the controller decide when to flush the updates.
|
|
155
226
|
*/
|
|
156
227
|
- (void)updateTabBarAppearance;
|
|
157
228
|
|
|
@@ -159,16 +230,17 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
159
230
|
* Updates the interface orientation based on selected tab screen and its children.
|
|
160
231
|
*
|
|
161
232
|
* This method does nothing if the update has not been previously requested.
|
|
162
|
-
* If needed, the requested update is performed immediately. If you do not need this, consider
|
|
163
|
-
* appropriate invalidation signal & let the controller decide when to flush the
|
|
233
|
+
* If needed, the requested update is performed immediately. If you do not need this, consider
|
|
234
|
+
* just raising an appropriate invalidation signal & let the controller decide when to flush the
|
|
235
|
+
* updates.
|
|
164
236
|
*/
|
|
165
237
|
- (void)updateOrientationIfNeeded;
|
|
166
238
|
|
|
167
239
|
/**
|
|
168
240
|
* Updates the interface orientation based on selected tab screen and its children.
|
|
169
241
|
*
|
|
170
|
-
* The requested update is performed immediately. If you do not need this, consider just raising
|
|
171
|
-
* invalidation signal & let the controller decide when to flush the updates.
|
|
242
|
+
* The requested update is performed immediately. If you do not need this, consider just raising
|
|
243
|
+
* an appropriate invalidation signal & let the controller decide when to flush the updates.
|
|
172
244
|
*/
|
|
173
245
|
- (void)updateOrientation;
|
|
174
246
|
|
|
@@ -176,8 +248,9 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
176
248
|
* Updates the layout direction based on property on host view.
|
|
177
249
|
*
|
|
178
250
|
* This method does nothing if the update has not been previously requested.
|
|
179
|
-
* If needed, the requested update is performed immediately. If you do not need this, consider
|
|
180
|
-
* appropriate invalidation signal & let the controller decide when to flush the
|
|
251
|
+
* If needed, the requested update is performed immediately. If you do not need this, consider
|
|
252
|
+
* just raising an appropriate invalidation signal & let the controller decide when to flush the
|
|
253
|
+
* updates.
|
|
181
254
|
*
|
|
182
255
|
* This method is necessary only on iOS versions prior to 17.
|
|
183
256
|
* On iOS 17+, use `traitOverrides.layoutDirection` on the controller directly.
|
|
@@ -187,8 +260,8 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
187
260
|
/**
|
|
188
261
|
* Updates the layout direction based on property on host view.
|
|
189
262
|
*
|
|
190
|
-
* The requested update is performed immediately. If you do not need this, consider just raising
|
|
191
|
-
* invalidation signal & let the controller decide when to flush the updates.
|
|
263
|
+
* The requested update is performed immediately. If you do not need this, consider just raising
|
|
264
|
+
* an appropriate invalidation signal & let the controller decide when to flush the updates.
|
|
192
265
|
*
|
|
193
266
|
* This method is necessary only on iOS versions prior to 17.
|
|
194
267
|
* On iOS 17+, use `traitOverrides.layoutDirection` on the controller directly.
|
|
@@ -196,53 +269,33 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
196
269
|
* This method can only be called when `parentViewController` is not nil.
|
|
197
270
|
*/
|
|
198
271
|
- (void)updateLayoutDirectionBelowIOS17;
|
|
199
|
-
@end
|
|
200
|
-
|
|
201
|
-
#pragma mark - Signals
|
|
202
272
|
|
|
203
|
-
|
|
204
|
-
* This extension defines various invalidation signals that you can send to the controller, to notify it that it needs
|
|
205
|
-
* to take some action.
|
|
206
|
-
*/
|
|
207
|
-
@interface RNSTabBarController ()
|
|
208
|
-
|
|
209
|
-
/**
|
|
210
|
-
* Tell the controller that react provided tabs have changed (count / instances) & the child view controllers need to be
|
|
211
|
-
* updated.
|
|
212
|
-
*
|
|
213
|
-
* This also automatically raises `needsReactChildrenUpdate` flag, no need to call it manually.
|
|
214
|
-
*/
|
|
215
|
-
- (void)childViewControllersHaveChangedTo:(nonnull NSArray<RNSTabsScreenViewController *> *)childViewControllers;
|
|
216
|
-
|
|
217
|
-
/**
|
|
218
|
-
* Request navigation state update from the controller to the given one.
|
|
219
|
-
*
|
|
220
|
-
* If you want to execute multiple updates in sequence you must flush the container after each one separately.
|
|
221
|
-
*/
|
|
222
|
-
- (void)setPendingNavigationStateUpdate:(nullable RNSTabsNavigationState *)navState;
|
|
273
|
+
#pragma mark Individual invalidation flags (internal)
|
|
223
274
|
|
|
224
275
|
/**
|
|
225
|
-
* Tell the controller that react provided tabs have changed (count / instances) & the child
|
|
226
|
-
* updated.
|
|
276
|
+
* Tell the controller that react provided tabs have changed (count / instances) & the child
|
|
277
|
+
* view controllers need to be updated.
|
|
227
278
|
*
|
|
228
|
-
* Do not raise this signal only when you want to modify selected view controller. Use
|
|
229
|
-
* instead.
|
|
279
|
+
* Do not raise this signal only when you want to modify selected view controller. Use
|
|
280
|
+
* `setPendingNavigationStateUpdate` instead.
|
|
230
281
|
*/
|
|
231
282
|
@property (nonatomic, readwrite) bool needsUpdateOfChildViewControllers;
|
|
232
283
|
|
|
233
284
|
/**
|
|
234
|
-
* Tell the controller that some configuration regarding the tab bar apperance has changed & the
|
|
235
|
-
* update.
|
|
285
|
+
* Tell the controller that some configuration regarding the tab bar apperance has changed & the
|
|
286
|
+
* appearance requires update.
|
|
236
287
|
*/
|
|
237
288
|
@property (nonatomic, readwrite) bool needsUpdateOfTabBarAppearance;
|
|
238
289
|
|
|
239
290
|
/**
|
|
240
|
-
* Tell the controller that some configuration regarding interface orientation has changed & it
|
|
291
|
+
* Tell the controller that some configuration regarding interface orientation has changed & it
|
|
292
|
+
* requires update.
|
|
241
293
|
*/
|
|
242
294
|
@property (nonatomic, readwrite) bool needsOrientationUpdate;
|
|
243
295
|
|
|
244
296
|
/**
|
|
245
|
-
* Tell the controller that some configuration regarding layout direction has changed & it
|
|
297
|
+
* Tell the controller that some configuration regarding layout direction has changed & it
|
|
298
|
+
* requires update.
|
|
246
299
|
*
|
|
247
300
|
* This flag is necessary only on iOS versions prior to 17.
|
|
248
301
|
* On iOS 17+, use `traitOverrides.layoutDirection` on the controller directly.
|