Add old transition API back but allow call from background thread (#2135)

This commit is contained in:
Michael Schneider
2016-09-01 16:09:59 -07:00
committed by Adlai Holler
parent 7ef6c0ff2c
commit f8e135a1be
6 changed files with 43 additions and 93 deletions

View File

@@ -126,7 +126,7 @@
XCTestExpectation *expectation = [self expectationWithDescription:@"Call measurement completion block on main"];
[displayNode transitionLayoutWithSizeRange:ASSizeRangeMake(CGSizeZero, CGSizeZero) animated:YES measurementCompletion:^{
[displayNode transitionLayoutWithSizeRange:ASSizeRangeMake(CGSizeZero, CGSizeZero) animated:YES shouldMeasureAsync:YES measurementCompletion:^{
XCTAssertTrue(ASDisplayNodeThreadIsMain(), @"Measurement completion block should be called on main thread");
[expectation fulfill];
}];
@@ -207,7 +207,7 @@
node.layoutState = @2;
[node invalidateCalculatedLayout];
[node transitionLayoutAnimated:YES measurementCompletion:^{
[node transitionLayoutWithAnimation:YES shouldMeasureAsync:YES measurementCompletion:^{
// Push this to the next runloop to let async insertion / removing of nodes finished before checking
dispatch_async(dispatch_get_main_queue(), ^{
XCTAssertEqual(node.subnodes[0], node2);