Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix SIMULATE_WEB_RESPONSE not imported #449 #450

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions examples/ASCollectionView/Sample/ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
//

#import "ViewController.h"

#import "AppDelegate.h"
#import <AsyncDisplayKit/AsyncDisplayKit.h>
#import "SupplementaryNode.h"
#import "ItemNode.h"
Expand Down Expand Up @@ -82,18 +82,18 @@ - (void)viewDidLoad
{
NSLog(@"ViewController is not nil");
strongSelf->_data = [[NSArray alloc] init];
[strongSelf->_collectionView performBatchUpdates:^{
[strongSelf->_collectionView insertSections:[[NSIndexSet alloc] initWithIndexesInRange:NSMakeRange(0, 100)]];
[strongSelf->_collectionNode performBatchUpdates:^{
[strongSelf->_collectionNode insertSections:[[NSIndexSet alloc] initWithIndexesInRange:NSMakeRange(0, 100)]];
} completion:nil];
NSLog(@"ViewController finished updating collectionView");
NSLog(@"ViewController finished updating collectionNode");
}
else {
NSLog(@"ViewController is nil - won't update collectionView");
NSLog(@"ViewController is nil - won't update collectionNode");
}
};

dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), mockWebService);
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(4 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While I'm not opposing to the change at this line, I'm interested in your reasons.

Copy link
Contributor Author

@wsdwsd0829 wsdwsd0829 Jul 23, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not know why need last dispatch, current behavior is when click push, the collection node/view will display after 2 second, then pop after another 2s (thus 4 total)
Actually I think we do not need to pop automatically, this change just try to make minimal change

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To make minimal change, let's revert the change here (i.e change it back to 4 seconds).

[self.navigationController popViewControllerAnimated:YES];
});
#endif
Expand Down