Delegate method not called due to failing hit test
Created new objective-c project (iOS 9.2, XCode 7.2). Added as framework using cocoapods.
UIView added to storyboard, added auto layout constraints for bottom, trailing, width and aspect. Implemented datasource and delegate protocol in view controller, set in viewWillAppear to the buttons properties.
Button displays fine, opens properly the cells.
But neither does it close again nor does it call the delegate whenever I click onto a cell.
Debugging shows the the hitTest is failing for the cells:
if (CGRectContainsPoint(cell.bounds, pointForTargetView)) is always FALSE.
Example values for a button on the lower right corner of an iPad screen:
pointForTargetView: ▿ CGPoint
- x : 961.5
- y : 1171.5
cell.bounds: ▿ CGRect ▿ origin : CGPoint - x : 0.0 - y : 0.0 { ... } ▿ size : CGSize - width : 0.0 { ... } - height : 0.0 { ... }
The cell returns an empty CGRect, thus the test will fail. Was able to reproduce it multiple times with different simulators.
Any Ideas ?
Kind Regards, Oggerschummer
@Oggerschummer I was facing the same issue. Try retaining the LiquidFloatingCell instances that you return via datasource in your viewcontroller.
+1 @princebhargava worked for me