Files
react-native/packages/react-native/Libraries/Image/RCTDisplayWeakRefreshable.mm
T
Lulu WuandFacebook GitHub Bot 42d67452eb Move .m to .mm to make obj-c and C++ headers compatible (#38135)
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
2023-07-24 08:13:07 -07:00

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