mirror of
https://github.com/TextureGroup/Texture.git
synced 2026-04-07 19:17:39 +00:00
* Update to Xcode 15 ## Summary We want to make Texture build with recent tools like Xcode 15. Part of this is bumping the minimum supported OS to iOS 14. I only removed the dead code (i.e. code gated on versions older than iOS 14). There are still some warnings about outdated APIs in use, but they are non-trivial changes to fix. ## Test plan Run all the examples. Run all the unit tests and make them pass. * Use Xcode 15.3 so we have 17.4 simulators * Fixing an asset catalog compiler error when building against iPhone SE * Fix a couple of file extensions for assets A couple of PNGs were marked as JPGs
39 lines
1.5 KiB
Plaintext
39 lines
1.5 KiB
Plaintext
//
|
|
// ASSnapshotTestCase.mm
|
|
// Texture
|
|
//
|
|
// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
|
|
// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved.
|
|
// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0
|
|
//
|
|
|
|
#import "ASSnapshotTestCase.h"
|
|
#import <AsyncDisplayKit/ASAvailability.h>
|
|
#import <AsyncDisplayKit/ASDisplayNode+Beta.h>
|
|
#import <AsyncDisplayKit/ASDisplayNodeExtras.h>
|
|
#import <AsyncDisplayKit/ASDisplayNode+Subclasses.h>
|
|
|
|
NSOrderedSet *ASSnapshotTestCaseDefaultSuffixes(void)
|
|
{
|
|
NSMutableOrderedSet *suffixesSet = [[NSMutableOrderedSet alloc] init];
|
|
[suffixesSet addObject:@"_64"];
|
|
return [suffixesSet copy];
|
|
}
|
|
|
|
@implementation ASSnapshotTestCase
|
|
|
|
+ (void)hackilySynchronouslyRecursivelyRenderNode:(ASDisplayNode *)node
|
|
{
|
|
// Disable asynchronous display for rendering snapshots since things like UITraitCollection are thread-local
|
|
// so changes to them (`-[UITraitCollection performAsCurrentTraitCollection]`) aren't preserved across threads.
|
|
// Since the goal of this method is to just to ensure a node is rendered before snapshotting, this should be reasonable default for all callers.
|
|
ASTraitCollectionPropagateDown(node, ASPrimitiveTraitCollectionFromUITraitCollection(UITraitCollection.currentTraitCollection));
|
|
node.displaysAsynchronously = NO;
|
|
ASDisplayNodePerformBlockOnEveryNode(nil, node, YES, ^(ASDisplayNode * _Nonnull node) {
|
|
[node.layer setNeedsDisplay];
|
|
});
|
|
[node recursivelyEnsureDisplaySynchronously:YES];
|
|
}
|
|
|
|
@end
|