Skip to content

fix SIMULATE_WEB_RESPONSE not imported #449 - #450

Merged
nguyenhuy merged 4 commits into
TextureGroup:masterfrom
wsdwsd0829:fix-ascollectionview-example
Aug 14, 2017
Merged

nguyenhuy merged 4 commits into
TextureGroup:masterfrom
wsdwsd0829:fix-ascollectionview-example

Conversation

@wsdwsd0829

@wsdwsd0829 wsdwsd0829 commented Jul 17, 2017 •

Copy link
Copy Markdown
Contributor

I could not found the correct format for "license as suggested by our bot", what should I use exactly?

@CLAassistant

CLAassistant commented Jul 17, 2017 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@nguyenhuy nguyenhuy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for contributing, @wsdwsd0829! Please change the file license as suggested by our bot and other small stuffs.

[strongSelf->_collectionNode performBatchUpdates:^{
[strongSelf->_collectionNode insertSections:[[NSIndexSet alloc] initWithIndexesInRange:NSMakeRange(0, 100)]];
} completion:nil];
NSLog(@"ViewController finished updating collectionView");

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please update the comments here and a couple of lines below to use "collectionNode"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

with SIMULATE_WEB_RESPONSE, compiler will give error saying collectionView undefined, this change will follow the property to use collectionNode

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yes, I understand the change here. I was suggesting to update the logs to use "collectionNode":
NSLog(@"ViewController finished updating collectionNode") and NSLog(@"ViewController is nil - won't update collectionNode"). Sorry for the confusion :)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Actually, if we keep using 2s it will cause crash at L115 ASCollectionLayout, because poping VC and layout happen at same time; So I keep 4.

  • (CGSize)collectionViewContentSize
    {
    ...
    ASDisplayNodeAssertNotNil(_layout, @"Collection layout state should not be nil at this point")
    ...

Let me know if it's potential bug and how to fix it. Thanks.


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
Copy Markdown
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.

@wsdwsd0829 wsdwsd0829 Jul 23, 2017 •

Copy link
Copy Markdown
Contributor Author

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
Copy Markdown
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).


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
Copy Markdown
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).

[strongSelf->_collectionNode performBatchUpdates:^{
[strongSelf->_collectionNode insertSections:[[NSIndexSet alloc] initWithIndexesInRange:NSMakeRange(0, 100)]];
} completion:nil];
NSLog(@"ViewController finished updating collectionView");

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yes, I understand the change here. I was suggesting to update the logs to use "collectionNode":
NSLog(@"ViewController finished updating collectionNode") and NSLog(@"ViewController is nil - won't update collectionNode"). Sorry for the confusion :)

@nguyenhuy nguyenhuy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM now. Thank you for the contribution!

@nguyenhuy
nguyenhuy merged commit a929950 into TextureGroup:master Aug 14, 2017
bernieperez pushed a commit to AtomTickets/Texture that referenced this pull request Apr 25, 2018
* fix SIMULATE_WEB_RESPONSE not imported (Reported in TextureGroup#449).

* changes per review

* Update license of ViewController.m
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants