Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use Objective-C nullability to provide better Swift types in RCTAppDe…
…legate (#42236) Summary: This PR adds nullable type annotations + nullability audit regions (`NS_ASSUME_NONNULL_BEGIN`/`NS_ASSUME_NONNULL_END`) to provide better Swift types. Before: ```swift class AppDelegate: RCTAppDelegate { override func sourceURL(for bridge: RCTBridge!) -> URL! { self.bundleURL() } override func bundleURL() -> URL! { RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot: "js/RNTesterApp.ios") } override func customize(_ rootView: RCTRootView!) { rootView.backgroundColor = .red } } ``` After: ```swift class AppDelegate: RCTAppDelegate { override func sourceURL(for bridge: RCTBridge) -> URL { self.bundleURL() } override func bundleURL() -> URL { RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot: "js/RNTesterApp.ios") } override func customize(_ rootView: RCTRootView) { rootView.backgroundColor = .red } } ``` ## Changelog: [IOS] [ADDED] - Provide better Swift types for RCTAppDelegate and RCTBridgeDelegate Pull Request resolved: #42236 Test Plan: In Xcode click the top left square button and look up the generated interface: ![CleanShot 2024-01-10 at 16 40 51@2x](https://github.com/facebook/react-native/assets/52801365/ad2ac9ed-9d9a-4c5e-a200-1d7a2802e701) Reviewed By: christophpurrer Differential Revision: D52660647 Pulled By: cipolleschi fbshipit-source-id: d4d3c36b3f420b3490145c491cd3781613f4b111
- Loading branch information