这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@phimage
Copy link
Member

@phimage phimage commented Jan 22, 2020

using view or collectionViewCellContentView keys

Add unit test with collectionViewCellContentView

Rename the class because CollectionViewContentView is not correct. CollectionViewCellContentView is.
But I use a CollectionViewCell.ContentView

…ectionViewCellContentView` keys

Add unit test with `collectionViewCellContentView`
Copy link
Contributor

@kateinoigakukun kateinoigakukun left a 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 {
Copy link
Contributor

@kateinoigakukun kateinoigakukun Jan 23, 2020

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?

Copy link
Member Author

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 🥴

Copy link
Contributor

@r-plus r-plus Jan 24, 2020

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 view and collectionViewCellContentView keys 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>

Copy link
Member Author

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

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.

4 participants