-
-
Notifications
You must be signed in to change notification settings - Fork 513
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: change -[RNSScreenContainer init]
to call -[UIView initWithFrame:]
designated initalizer
#2161
fix: change -[RNSScreenContainer init]
to call -[UIView initWithFrame:]
designated initalizer
#2161
Conversation
…ame:]` designated initalizer
Hey @Brett-Best, while indeed we do not call designated initializer on our parent class (thus this change makes sense) but I do not see a scenario of how this would lead to a crash? Could you elaborate a bit? |
We have a subclass of Changing to the designated initialiser makes #0 in NativeAppView.init(frame:) ()
#1 in @objc NativeAppView.init(frame:) ()
#2 in -[RNSScreenContainerView init] at /node_modules/react-native-screens/ios/RNSScreenContainer.mm:63
#3 in NativeAppView.init(analyticsInteractor:bundleProvider:deepLinkRouter:routeConfigService:router:screenDimensionsManager:socialProfileInteractor:) at mobile/Bridge/NativeComponents/NativeAppView.swift:75
#4 in NativeAppView.__allocating_init(analyticsInteractor:bundleProvider:deepLinkRouter:routeConfigService:router:screenDimensionsManager:socialProfileInteractor:) ()
#5 in closure #1 in NativeAppViewManager.view() at mobile/Bridge/NativeComponents/NativeAppViewManager.swift:49
#6 in partial apply for closure #1 in NativeAppViewManager.view() ()
#7 in static MainActor.assumeIsolated<τ_0_0>(_:file:line:) ()
#8 in static MainActor.assumeIsolated<τ_0_0>(_:file:line:) ()
#9 in NativeAppViewManager.view() at mobile/Bridge/NativeComponents/NativeAppViewManager.swift:48
#10 in @objc NativeAppViewManager.view() ()
#11 in -[RCTComponentData createViewWithTag:rootTag:] at /node_modules/react-native/React/Views/RCTComponentData.m:82
#12 in __50-[RCTUIManager createView:viewName:rootTag:props:]_block_invoke at /node_modules/react-native/React/Modules/RCTUIManager.m:1007 |
@kkafar any chance this could also get included in the release this week if all goes well? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah yeah, I think we're fine here now. Thanks for these details!
Description
Ensures
RNSScreenContainer
UIView
subclass calls a designated initializer, this fixes an issue where subclassingRNSScreenContainer
would recursively loop through the inits - ending in a crash.UIView.h
has:- (instancetype)initWithFrame:(CGRect)frame NS_DESIGNATED_INITIALIZER;
Checklist