LiquidFloatingActionButton icon indicating copy to clipboard operation
LiquidFloatingActionButton copied to clipboard

Delegate method not called due to failing hit test

Open Oggerschummer opened this issue 10 years ago • 2 comments

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 avatar Dec 22 '15 15:12 Oggerschummer

@Oggerschummer I was facing the same issue. Try retaining the LiquidFloatingCell instances that you return via datasource in your viewcontroller.

prashbh avatar Feb 05 '16 19:02 prashbh

+1 @princebhargava worked for me

dazzz1er avatar Apr 06 '16 10:04 dazzz1er