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

[IGListKit] Extended IGListKit support for displaying delegates #1011

Merged
merged 128 commits into from
May 21, 2020
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
128 commits
Select commit Hold shift + click to select a range
3a007fc
Extended IGListKit support for node deselect, highlight and unhighlight
hebertialmeida Jul 5, 2018
755a1eb
Proposal of renaming willDisplayItemWithNode and didEndDisplayingItem…
hebertialmeida Jul 5, 2018
c1699c4
Extended support for IGListDisplayDelegate
hebertialmeida Jul 5, 2018
fc94d8e
Updated changelog with displaying delegates change
hebertialmeida Jul 6, 2018
822f16d
Removed extra deprecation supression flag
hebertialmeida Jul 6, 2018
37398c0
Reverted ASCollectionNode changes and implemented displaing delegate …
hebertialmeida Jul 11, 2018
7905d1e
Sending a real UICollectionViewCell to the delegate if not nil
hebertialmeida Jul 11, 2018
d941a03
Added safety check for nil indexPaths
hebertialmeida Jul 11, 2018
6ee40ba
Merge branch 'master' into HAImproveIGListSupport
hebertialmeida Aug 30, 2018
4657343
Merge branch 'master' into HAImproveIGListSupport
hebertialmeida Feb 19, 2019
05e2ce2
Discard any CHANGELOG changes for fix Danger error
hebertialmeida Feb 19, 2019
0078f5f
Merge branch 'master' into HAImproveIGListSupport
hebertialmeida Feb 20, 2019
ac08bb8
Add an experimental flag to use native dispatch_apply (#1345)
Adlai-Holler Feb 21, 2019
2fbc452
Don't return non-animated GIFs for animation (update to latest PINRem…
garrettmoon Feb 21, 2019
37e5955
Fix typos (#1348)
Feb 22, 2019
c284847
Revert "Have node and controller share lock (#1227)" (#1347)
Adlai-Holler Feb 22, 2019
60ee8d4
Don't compile out ASExperimentalTextNode if ASTextNode is compiled ou…
maicki Mar 3, 2019
71eb5a3
Lock up to yogaRoot during layout to avoid deadlocks. (#1356)
wiseoldduck Mar 3, 2019
72d4d79
Update layout-transition-api.md (#1357)
dirtmelon Mar 3, 2019
877b6cd
Optimize ASTwoDimensionalArrayUtils (#1351)
Adlai-Holler Mar 3, 2019
378e0d2
If we check for batching before content size is available we'll alway…
garrettmoon Mar 4, 2019
49dd925
Do not lock the nodeController if we are not locking to root. (#1360)
wiseoldduck Mar 5, 2019
fd223d0
Resolve root constrained size before informing delegate to resolve in…
wiseoldduck Mar 5, 2019
f3c2ad7
Add `setNeedsLayout` to yoga tree changes. (#1361)
wiseoldduck Mar 5, 2019
d4a1754
Make ASCollectionElement Public (#1303)
JonathanDowning Mar 5, 2019
03746f0
Optimize _assertSubnodeState (#1352)
Adlai-Holler Mar 5, 2019
e20c651
_ASCollectionViewCell - The point isn't converted before to send to n…
Idefix60 Mar 5, 2019
954382d
Optimize ASCATransactionQueue (#1350)
Adlai-Holler Mar 6, 2019
e498969
Cleanup Yoga Categories (#1364)
maicki Mar 6, 2019
abf0212
Add forwarding of UIAccessibilityAction methods (#1344)
smeis Mar 6, 2019
f7182c7
Don't add extraneous truncation token during kCTLineTruncationMiddle.…
wiseoldduck Mar 6, 2019
88dd4a2
Update the FAQ to throw less shade. (#1379)
garrettmoon Mar 7, 2019
1a2e397
[Updated Snapshots] Don't add extraneous truncation token during kCTL…
wiseoldduck Mar 7, 2019
9d633d5
Launches switching ASNetworkImageNode callbacks to global queue. (#1369)
garrettmoon Mar 7, 2019
5b1e14c
Make ASTextNode2 more forgiving when searching for links (#1374)
Adlai-Holler Mar 7, 2019
0547eaa
Experiment with different strategies for image downloader priority (#…
nguyenhuy Mar 8, 2019
54ddc3d
Whoops, someone forgot an else! (#1385)
garrettmoon Mar 8, 2019
4a16e99
Catch invalid sizes during yoga layout (#1376)
wiseoldduck Mar 8, 2019
5827e97
Correct View vs. Layer here (tho it doesn't make any difference) (#1378)
wiseoldduck Mar 8, 2019
2c0dfda
Expose initial constrained size before layout in case anyone is inter…
wiseoldduck Mar 8, 2019
975cd37
Assert for context creation failure during displayBlock. (#1373)
wiseoldduck Mar 8, 2019
46e2a81
Fix an issue where state change notifications can be sent mulitple ti…
wiseoldduck Mar 8, 2019
17f9b00
Add Yoga support to ASButtonNode (#1381)
maicki Mar 8, 2019
f17b9e2
Fix CTLineRef leaks (#1386)
bolsinga Mar 8, 2019
932289f
Correct attributes lookup for supplementary elements. (#1318)
wiseoldduck Mar 8, 2019
b20e007
Need some more locks for working with calculated yoga layouts (#1388)
wiseoldduck Mar 9, 2019
19e7bc3
Adds support for using UIGraphicsImageRenderer in ASTextNode. (#1384)
garrettmoon Mar 9, 2019
36d14ac
Add UIDataSourceModelAssociation to ASTableView and ASCollectionView …
farktronix Mar 9, 2019
fbddcd4
Rename ASDN C++ namespace to AS (#1366)
Adlai-Holler Mar 9, 2019
a1768e2
Clean up a clang analyzer cast error (#1387)
bolsinga Mar 9, 2019
f67f968
Update for 9.4.1 CI (#1392)
garrettmoon Mar 11, 2019
fb5820a
Remove experimental features (exp_skip_a11y_wait && exp_new_default_c…
ernestmama Mar 11, 2019
ad53898
Make experiment checks faster (#1393)
Adlai-Holler Mar 12, 2019
79323c1
Make shared CA transaction queue variable extern so it's actually sha…
Adlai-Holler Mar 12, 2019
d5339ac
Fix header typo (#1402)
Adlai-Holler Mar 12, 2019
902131a
Context is a pretty general name that will cause conflicts with subcl…
garrettmoon Mar 12, 2019
88291f2
Suppress documentation warnings when using external libraries (#1401)
bolsinga Mar 13, 2019
45d9050
Add layer-action support to nodes (#1396)
Adlai-Holler Mar 13, 2019
602a1b2
Avoid an unnecessary lock & unlock pair in ASMainSerialQueue (#1409)
nguyenhuy Mar 16, 2019
ad0d4d6
Add clang-format for a common source code format (#1365)
maicki Mar 16, 2019
44846e8
Fix GIF Caching (#1405)
ay8s Mar 18, 2019
1bbddab
Add support for reverse direction to yoga layouts (#1413)
wiseoldduck Mar 20, 2019
66532c6
Only set ASLayoutElementStyle delegate if Yoga is enabled (#1417)
maicki Mar 21, 2019
4766a0b
Fix bug in ASRangeController that causes some cell nodes of a collect…
nguyenhuy Mar 22, 2019
30600cb
Fix a bug with Yoga nodes whose position change and don't update. (#1…
tnorman42 Mar 22, 2019
3415d1b
Follow up on the ASRangeController fix in #1418 (#1419)
nguyenhuy Mar 22, 2019
c340fff
Dev docs for threading in Texture (#1319)
mikezucc Mar 22, 2019
6aaf0dc
Removed locked jekyll version (#1322)
mikezucc Mar 22, 2019
d34a182
showcase.md updated (#1421)
plotkin Mar 25, 2019
b6a6b0f
Experiment with disabling ASViewController background dealloc (#1420)
mikezucc Mar 25, 2019
a631803
[Experiment] Dont forget about these collection view background deall…
mikezucc Mar 27, 2019
6b81f5a
Fix retain cycle with transaction operations (#1429)
bolsinga Mar 29, 2019
7d105ec
Replace +load initializers with __attribute__((constructor)) function…
farktronix Mar 29, 2019
2234c47
Fix dealloc on bg (#1410)
wsdwsd0829 Mar 29, 2019
c47d6d5
Add support for clipping only specific corners, add unit tests (#1415)
Adlai-Holler Mar 29, 2019
fb1a586
[ASImageNode]fix incorrect backing size calculation (#1189)
junjielu Mar 29, 2019
976fd43
Have image nodes draw into opaque contexts automatically if possible …
Adlai-Holler Mar 29, 2019
c345733
Fix typo in batch-fetching-api.md (#1437)
dirtmelon Apr 1, 2019
0143c9f
[ASDisplayNode] Stop infinite layout in _u_measureNodeWithBoundsIfNec…
rcancro Apr 1, 2019
ef10f42
Add a verbose log for locking operations. Has no effect in production…
Adlai-Holler Apr 1, 2019
026eb1d
Wrap transaction operation retain cycle fix in an experiment (#1438)
bolsinga Apr 1, 2019
da3d4a2
Fix scroll node in yoga (#1435)
wsdwsd0829 Apr 2, 2019
14c1b76
Fix the stub for layerActionForKey: to let CA continue the search (#1…
Adlai-Holler Apr 4, 2019
9fed474
Revert "Have image nodes draw into opaque contexts automatically if p…
Adlai-Holler Apr 4, 2019
0a94eb0
Use instance lock for ASPrimitiveTraitCollection (#1442)
maicki Apr 4, 2019
7930476
Simplify ASTraitCollection propagation in ASViewController (#1447)
maicki Apr 5, 2019
4ec9ac6
Use AS::Mutex in ASCollectionElement (#1445)
maicki Apr 5, 2019
8dea604
[ASTextNode] Maintain isAccessibilityElement setting on text nodes wh…
smeis Apr 9, 2019
377aeeb
Add didEnterHierarchy/didExitHierarchy to ASNodeController. (#1444)
tnorman42 Apr 12, 2019
70b1161
Fix wrongly formatted RELEASE link (#1453)
BalestraPatrick Apr 15, 2019
5e98f46
Only create activities during debug (#1456)
Adlai-Holler Apr 16, 2019
3ca9f0c
[#1451] Add support for UIAccessibilityCustomAction (#1452)
shamanskyh Apr 17, 2019
dcd9905
Shut down graphics contexts experiment (#1458)
Adlai-Holler Apr 19, 2019
429891d
Remove lock of ASTextNodeRendererKey (#1454)
zhongwuzw Apr 19, 2019
6f1d359
Disable ASAssertLocked and ASAssertUnlocked (#1412)
nguyenhuy Apr 20, 2019
b0aabba
Try to remove global lock when initialising TextKit components (#1455)
zhongwuzw Apr 22, 2019
68a16b2
Make ASCollectionNode's pan gesture customizable (#1457)
OskarZhang Apr 23, 2019
601d4e2
Remove iOS 8 support from logging code. (#1462)
Adlai-Holler Apr 23, 2019
46f0266
Drop support for Xcode 8 and fix some compiler warnings (#1463)
Adlai-Holler Apr 23, 2019
1a7fdb8
Remove ASEventLog (#1460)
Adlai-Holler Apr 23, 2019
7757a60
Cover the other background dealloc surfaces (#1464)
mikezucc Apr 23, 2019
6346e49
Passthrough pagingEnabled for ASCollectionNode / ASTableNode (#1466)
maicki Apr 25, 2019
de7a206
Fix open context bug introduced in #1458 (#1468)
Adlai-Holler Apr 25, 2019
aee694b
Make sure all ASDisplayNode properties have backing ivars for consist…
Apr 30, 2019
5995708
Ensure ASControlMode properties lock before accessing their ivars (#1…
May 1, 2019
069f61b
Add a new "global drawing" experiment to use UIGraphicsRenderer (#1469)
Adlai-Holler May 3, 2019
0ce0ad0
Cut version 2.8.1 (#1491)
nguyenhuy May 6, 2019
3fe200f
Clean up documentation issues around periods (#1490)
amonshiz May 6, 2019
cdfa08f
Minor update in change log #changelog (#1492)
nguyenhuy May 6, 2019
d758fc7
Ship ASExperimentalFixRangeController (#1486)
nguyenhuy May 7, 2019
3e4ab11
Shrink _ASCollectionPendingState from 144 to 128 bytes, a 12.5% reduc…
May 7, 2019
44117ea
Shrink _ASPendingState from 824 to 808 bytes, reduction of ~2% (#1483)
May 7, 2019
01208b7
Shrink ASDisplayNode from 1072 to 968 bytes, reduction of 10.74% (#1484)
May 7, 2019
8d0457c
Shrink Button Node (#1494)
May 7, 2019
ad6b6ab
Shrink TextNode(2) (#1495)
May 7, 2019
b6fedde
Shrink Pager and Scroll Node (#1496)
May 7, 2019
d2ffbc0
Shrink ASImageNode by .6% and ASNetworkImageNode by 2.2% (#1487)
May 7, 2019
d62967f
Remove unused declaration, missed in #1460 (#1497)
May 7, 2019
9eb4053
Keep the atomics - does not affect memory work (#1498)
May 8, 2019
b4ed8c9
Shrink ASCellNode by 8 bytes (#1499)
May 8, 2019
27ef809
Shrink ASEditableTextNode by 16 bytes (#1500)
May 8, 2019
8892800
ASSignpost: Add support for the os_signpost API, fixes (#1501)
Adlai-Holler May 9, 2019
6329cf2
Shrink ASLayout (#1503)
May 9, 2019
a1b28e7
Cleanup whitespace #trivial (#1507)
wiseoldduck May 9, 2019
79a9982
Shrink LayoutSpec classes (#1502)
May 10, 2019
1ffbc64
Merge branch 'master' of github.com:hebertialmeida/Texture
hebertialmeida May 10, 2019
99e68a0
Merge remote-tracking branch 'upstream/master'
hebertialmeida May 20, 2020
238d5ff
Merge branch 'master' into HAImproveIGListSupport
hebertialmeida May 20, 2020
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## master
* Add your own contributions to the next release on the line below this with your name.
- [IGListKit] Extended IGListKit support for displaying delegates. [Heberti Almeida](https://github.com/hebertialmeida) [#1011](https://github.com/TextureGroup/Texture/pull/1011)
- [License] Simplify the Texture license to be pure Apache 2 (removing ASDK-Licenses).[Scott Goodson](https://github.com/appleguy) [#1077](https://github.com/TextureGroup/Texture/pull/1077)
- [ASNetworkImageNode] Allow delegate methods to be called on background thread. [Max Wang](https://github.com/wsdwsd0829). [#1007](https://github.com/TextureGroup/Texture/pull/1007)
- [ASLayoutTransition] Add support for preserving order after node moves during transitions. (This order defines the z-order as well.) [Kevin Smith](https://github.com/wiseoldduck) [#1006]
Expand Down
41 changes: 41 additions & 0 deletions Source/Private/ASIGListAdapterBasedDataSource.m
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,21 @@ - (void)collectionNode:(ASCollectionNode *)collectionNode didSelectItemAtIndexPa
[self.delegate collectionView:collectionNode.view didSelectItemAtIndexPath:indexPath];
}

- (void)collectionNode:(ASCollectionNode *)collectionNode didDeselectItemAtIndexPath:(NSIndexPath *)indexPath
{
[self.delegate collectionView:collectionNode.view didDeselectItemAtIndexPath:indexPath];
}

- (void)collectionNode:(ASCollectionNode *)collectionNode didHighlightItemAtIndexPath:(NSIndexPath *)indexPath
{
[self.delegate collectionView:collectionNode.view didHighlightItemAtIndexPath:indexPath];
}

- (void)collectionNode:(ASCollectionNode *)collectionNode didUnhighlightItemAtIndexPath:(NSIndexPath *)indexPath
{
[self.delegate collectionView:collectionNode.view didUnhighlightItemAtIndexPath:indexPath];
}

- (void)scrollViewDidScroll:(UIScrollView *)scrollView
{
[self.delegate scrollViewDidScroll:scrollView];
Expand Down Expand Up @@ -136,6 +151,32 @@ - (void)collectionNode:(ASCollectionNode *)collectionNode willBeginBatchFetchWit
[ctrl beginBatchFetchWithContext:context];
}

- (void)collectionNode:(ASCollectionNode *)collectionNode willDisplayItemWithNode:(ASCellNode *)node
{
NSIndexPath *indexPath = [collectionNode.view indexPathForNode:node];
UIView *contentView = node.view.superview;
UICollectionViewCell *cell = contentView.superview;

if (cell == nil || indexPath == nil) {
return;
}

[self.delegate collectionView:collectionNode.view willDisplayCell:cell forItemAtIndexPath:indexPath];
}

- (void)collectionNode:(ASCollectionNode *)collectionNode didEndDisplayingItemWithNode:(ASCellNode *)node
{
NSIndexPath *indexPath = [collectionNode.view indexPathForNode:node];
UIView *contentView = node.view.superview;
UICollectionViewCell *cell = contentView.superview;

if (cell == nil || indexPath == nil) {
return;
}

[self.delegate collectionView:collectionNode.view didEndDisplayingCell:cell forItemAtIndexPath:indexPath];
Copy link
Member

Choose a reason for hiding this comment

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

Actually, since we conform to ASCollectionDelegateInterop we should be already bridging these. See lines ~190 below, where we pass these calls directly through to the delegate.

Can you put breakpoints in there or investigate why we're not seeing them?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So, I've checked that and it never fires the delegate because don't pass this checking:

    if (node.shouldUseUIKitCell) {
      [(id <ASCollectionDelegateInterop>)_asyncDelegate collectionView:collectionView willDisplayCell:rawCell forItemAtIndexPath:indexPath];
    }

Here: https://github.com/TextureGroup/Texture/blob/master/Source/ASCollectionView.mm#L1183

I am trying to understand the shouldUseUIKitCell and why do we need the check here to fire that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If I comment out this check it works, Also I noticed that this will be always NO and will never fire the delegate because it is a read-only property, it is only "YES" if it is an ASWrapperCellNode.

Here it was checking:

[(id <ASCollectionDelegateInterop>)_asyncDelegate collectionView:collectionView willDisplayCell:rawCell forItemAtIndexPath:indexPath];

It was first introduced here:
c6e3dd7#diff-8b82b1556d1293f6f9789beb236c9271R1167

Simplified here:
63efdbd#diff-8b82b1556d1293f6f9789beb236c9271R1169

For ASWrapperCellNode I have also found this:
https://github.com/TextureGroup/Texture/blob/master/Source/ASCellNode.mm#L387-L393

and there is a comment

// TODO: Consider if other calls, such as willDisplayCell, should be bridged to this class.

Choose a reason for hiding this comment

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

Looks like @hebertialmeida is pointing out the problem, do this issue has any update?

Manual modifying ASIGListAdapterBasedDataSource.m isn't a nice solution for now as it is a private class. So it will be great if this issue get sort out and merge to master soon.

Thanks guys for the help.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@MiguelChiang Still waiting someone get back to me.

Copy link

Choose a reason for hiding this comment

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

@Adlai-Holler can you please take a look when you get a chance?

}

/**
* Note: It is not documented that ASCollectionNode will forward these UIKit delegate calls if they are implemented.
* It is not considered harmful to do so, and adding them to documentation will confuse most users, who should
Expand Down