-
Notifications
You must be signed in to change notification settings - Fork 22
Try to decode CollectionViewCell content view Fix #72
#73
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
base: master
Are you sure you want to change the base?
Conversation
…ectionViewCellContentView` keys Add unit test with `collectionViewCellContentView`
kateinoigakukun
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! but we need to discuss a little more 👍
| } | ||
| } | ||
|
|
||
| class ToggleKey { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Umm, ToggleKey seems very dependent on order of how container decode the view.
And I think there will be more version dependent decode operation in the future, so I want to avoid this kind of complex idiom.
Could you consider passing IB version and switch the key by version?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, like we discuss in the issue.
I could not do it immediately, that's why I make this dirty fix 🥴
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm thinking use of IB version is not good idea because existing xml key will not automatically changed by Xcode 11.
- Create collection view cell at XIB file by Xcode 10
- Open it by Xcode 11
- Add one more collection view cell, result is
viewandcollectionViewCellContentViewkeys mixed xml like this.
<collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" id="uzK-LR-Mxj">
<rect key="frame" x="0.0" y="0.0" width="50" height="50"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" insetsLayoutMarginsFromSafeArea="NO">
<rect key="frame" x="0.0" y="0.0" width="50" height="50"/>
<autoresizingMask key="autoresizingMask"/>
</view>
<viewLayoutGuide key="safeArea" id="7dg-fX-HkR"/>
<point key="canvasLocation" x="-2" y="58"/>
</collectionViewCell>
<collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" id="LEX-Ny-2b1">
<rect key="frame" x="0.0" y="0.0" width="50" height="50"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<collectionViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" insetsLayoutMarginsFromSafeArea="NO" id="BjQ-7p-u3U">
<rect key="frame" x="0.0" y="0.0" width="50" height="50"/>
<autoresizingMask key="autoresizingMask"/>
</collectionViewCellContentView>
<point key="canvasLocation" x="32" y="234"/>
</collectionViewCell>There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok so testing the two key is the only solution
but maybe we could find a more elegant way
using
vieworcollectionViewCellContentViewkeysAdd unit test with
collectionViewCellContentViewRename the class because
CollectionViewContentViewis not correct.CollectionViewCellContentViewis.But I use a
CollectionViewCell.ContentView