Skip to content

Commit

Permalink
fix(ios): fix nullability warnings (#36247)
Browse files Browse the repository at this point in the history
Summary:
While testing `use_frameworks! :linkage => :static`, I encountered nullability warnings that were previously suppressed because we always build with `-Werror`. I'm not sure why the suppressions no longer work, but they should just be fixed.

## Changelog

[IOS] [FIXED] - Fix nullability warnings

Pull Request resolved: #36247

Test Plan: iOS build should succeed.

Reviewed By: cipolleschi

Differential Revision: D43531887

Pulled By: javache

fbshipit-source-id: cae0617a20c8d215042cf4c5be2cbb17c801bb41
  • Loading branch information
tido64 authored and facebook-github-bot committed Feb 24, 2023
1 parent a7f962c commit 346b028
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
6 changes: 5 additions & 1 deletion React/Base/RCTJSScriptLoaderModule.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,16 @@

@class RCTSource;

NS_ASSUME_NONNULL_BEGIN

/**
* This protocol should be adopted when a turbo module needs to tell React Native to load a script.
* In bridge-less React Native, it is a replacement for [_bridge loadAndExecuteSplitBundleURL:].
*/
@protocol RCTJSScriptLoaderModule <NSObject>

@property (nonatomic, copy, nonnull) void (^loadScript)(RCTSource *source);
@property (nonatomic, copy) void (^loadScript)(RCTSource *source);

@end

NS_ASSUME_NONNULL_END
12 changes: 8 additions & 4 deletions React/CoreModules/RCTTiming.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,25 @@
#import <React/RCTInitializing.h>
#import <React/RCTInvalidating.h>

NS_ASSUME_NONNULL_BEGIN

@protocol RCTTimingDelegate

- (void)callTimers:(NSArray<NSNumber *> *)timers;
- (void)immediatelyCallTimer:(nonnull NSNumber *)callbackID;
- (void)callIdleCallbacks:(nonnull NSNumber *)absoluteFrameStartMS;
- (void)immediatelyCallTimer:(NSNumber *)callbackID;
- (void)callIdleCallbacks:(NSNumber *)absoluteFrameStartMS;

@end

@interface RCTTiming : NSObject <RCTBridgeModule, RCTInvalidating, RCTFrameUpdateObserver, RCTInitializing>

- (instancetype)initWithDelegate:(id<RCTTimingDelegate>)delegate;
- (void)createTimerForNextFrame:(nonnull NSNumber *)callbackID
- (void)createTimerForNextFrame:(NSNumber *)callbackID
duration:(NSTimeInterval)jsDuration
jsSchedulingTime:(NSDate *)jsSchedulingTime
jsSchedulingTime:(nullable NSDate *)jsSchedulingTime
repeats:(BOOL)repeats;
- (void)deleteTimer:(double)timerID;

@end

NS_ASSUME_NONNULL_END

0 comments on commit 346b028

Please sign in to comment.