Summary: Add macOS dependencies and alternative classes to the libraries that FlipperKitLayoutPlugin needs to function. Reviewed By: priteshrnandgaonkar Differential Revision: D27328277 fbshipit-source-id: f22d1e9f6a5415cee0bae8eaada653be5f5467b3
42 lines
984 B
Plaintext
42 lines
984 B
Plaintext
/*
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
|
|
#if TARGET_OS_IPHONE
|
|
#if FB_SONARKIT_ENABLED
|
|
|
|
#import "UICollectionView+SKInvalidation.h"
|
|
|
|
#import "SKInvalidation.h"
|
|
#import "SKSwizzle.h"
|
|
|
|
FB_LINKABLE(UICollectionView_SKInvalidation)
|
|
@implementation UICollectionView (SKInvalidation)
|
|
|
|
+ (void)enableInvalidations {
|
|
static dispatch_once_t onceToken;
|
|
dispatch_once(&onceToken, ^{
|
|
swizzleMethods(
|
|
[self class],
|
|
@selector(cellForItemAtIndexPath:),
|
|
@selector(swizzle_cellForItemAtIndexPath:));
|
|
});
|
|
}
|
|
|
|
- (UICollectionViewCell*)swizzle_cellForItemAtIndexPath:
|
|
(NSIndexPath*)indexPath {
|
|
dispatch_async(dispatch_get_main_queue(), ^{
|
|
[[SKInvalidation sharedInstance].delegate invalidateNode:self];
|
|
});
|
|
|
|
return [self swizzle_cellForItemAtIndexPath:indexPath];
|
|
}
|
|
|
|
@end
|
|
|
|
#endif // FB_SONARKIT_ENABLED
|
|
#endif
|