You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[SR-11267] KeyValueObserving on isSelected for UICollectionViewCell called even after retuning false in the UICollectionViewDelegate method shouldSelectItem
#3987
Open
swift-ci opened this issue
Aug 7, 2019
· 2 comments
based on certain conditional validation, i'm returning false from the shouldSelectItem delegate method on UICollectionView. This delegate method is called when i select an item on the UICollectionView.
Also, strangely, this method is called after the observer is called. I would expect observer on isSelected to be called based on my boolean value in shouldSelectItem - as this event will actually advise whether the item should be selected or not.
Actual Result:
Irrespective of whether i return true / false, the observer is always called.
Expected Result:
It should fire the observer only if i return true from shouldSelectItem.
The text was updated successfully, but these errors were encountered:
KVO, and the Swift overlay, are not responsible for when observations fire. This should likely be a bug you file with bugreport.apple.com rather than here.
Environment
XCode Version 10.2 (10E125)
Model Name: MacBook Pro
Model Identifier: MacBookPro14,3
Processor Name: Intel Core i7
Processor Speed: 2.8 GHz
Number of Processors: 1
Total Number of Cores: 4
L2 Cache (per Core): 256 KB
L3 Cache: 6 MB
Hyper-Threading Technology: Enabled
Memory: 16 GB
Boot ROM Version: 194.0.0.0.0
SMC Version (system): 2.45f0
Serial Number (system): XXXXX
Hardware UUID: XXXXX
Additional Detail from JIRA
md5: 58b9f49efe7fb0b26557067ce54ea7fd
Issue Description:
I have a UICollectionView and i have added a KVO on UICollectionViewCell item
based on certain conditional validation, i'm returning false from the shouldSelectItem delegate method on UICollectionView. This delegate method is called when i select an item on the UICollectionView.
Also, strangely, this method is called after the observer is called. I would expect observer on isSelected to be called based on my boolean value in shouldSelectItem - as this event will actually advise whether the item should be selected or not.
Actual Result:
Irrespective of whether i return true / false, the observer is always called.
Expected Result:
It should fire the observer only if i return true from shouldSelectItem.
The text was updated successfully, but these errors were encountered: