mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/38135 Changelog: [iOS][Changed] - Move .m to .mm to make obj-c and C++ headers compatible Reviewed By: RSNara Differential Revision: D47140743 fbshipit-source-id: 1f1fb24571f5154b17992d6a71587803407b9dd1
32 lines
841 B
Plaintext
32 lines
841 B
Plaintext
/*
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
|
|
#import "RCTDisplayWeakRefreshable.h"
|
|
|
|
@implementation RCTDisplayWeakRefreshable
|
|
|
|
+ (CADisplayLink *)displayLinkWithWeakRefreshable:(id<RCTDisplayRefreshable>)refreshable
|
|
{
|
|
RCTDisplayWeakRefreshable *target = [[RCTDisplayWeakRefreshable alloc] initWithRefreshable:refreshable];
|
|
return [CADisplayLink displayLinkWithTarget:target selector:@selector(displayDidRefresh:)];
|
|
}
|
|
|
|
- (instancetype)initWithRefreshable:(id<RCTDisplayRefreshable>)refreshable
|
|
{
|
|
if (self = [super init]) {
|
|
_refreshable = refreshable;
|
|
}
|
|
return self;
|
|
}
|
|
|
|
- (void)displayDidRefresh:(CADisplayLink *)displayLink
|
|
{
|
|
[_refreshable displayDidRefresh:displayLink];
|
|
}
|
|
|
|
@end
|