UITableView will not select cell if it contains a UICollectionView, even if the collectionView has selection of its own disabled
| Originator: | hotngui | ||
| Number: | rdar://28742912 | Date Originated: | 12/12/2016 |
| Status: | Closed | Resolved: | Yes |
| Product: | iOS | Product Version: | 10.0.2 |
| Classification: | Serious Bug | Reproducible: | Yes |
Summary: I have occasion to create a UITableView that contains cells that themselves contain UICollectionView instances. Those collectionView instances need to scroll, but not support selection. I would expect that since I set allowsSelection to false on the UICollectionView that a tap gesture would propagate up and select the UITableViewCell containing the collectionView. Steps to Reproduce: 1. Unzip the attached file 2. Build and run the project. 3. Tap on the red cell. Expected Results: The UITableViewCell should be selected and echo a debug message to the console. Actual Results: Nothing Version: iOS 9.3.5, iOS 10.0.2, iOS 10.1 Beta 3 Notes: Configuration: iPhone 6s, iPhone 7+, various simulators Apple's Response: From the sample project attached, the UICollectionView is the full size of its containing table view cell, which will cause the collection view to intercept touches from the table view cell and table view. The WWDC session “Advanced Scrollviews and Touch Handling Techniques” covers ways to handle this situation in depth: https://developer.apple.com/videos/play/wwdc2014/235/
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!