Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No Swipe Animation or View Even though Delegate Fires #186

Closed
thephatp opened this issue Jul 9, 2014 · 6 comments
Closed

No Swipe Animation or View Even though Delegate Fires #186

thephatp opened this issue Jul 9, 2014 · 6 comments

Comments

@thephatp
Copy link

thephatp commented Jul 9, 2014

It appears in debugging that SWTableViewCell is doing what it's meant to do from the perspective of getting to the point of firing the delegate methods. However, for some reason, it's not doing anything on my cell.

Touch and drag does nothing until I release, and then all it does is call the "scrollingToState" delegate method. I figured this would be called with each gesture location update--IOW many times while I drag. Once done dragging, still nothing happens.

So, the delegate gets called but nothing happens.

Any thoughts as to why?

I've been at this for 2 days now and about ready to give up. Any help is greatly appreciated. I really would like to use this control, but just am out of ideas.

@CEWendel
Copy link
Owner

CEWendel commented Jul 9, 2014

Is this on iOS 7 or 8?

@thephatp
Copy link
Author

thephatp commented Jul 9, 2014

It's on iOS 7. A couple of other notes:

  • I'm using auto-layout, but your SWTableViewCell supports auto-layout, so that shouldn't be it.
  • I've set the tableView.separatorInset since I'm on iOS 7.
  • I'm using a prototype cell, so no need to register nib.
  • I've ensured the buttons have images (left side) or title (right side), so views are not nil.

I didn't see anyone else mention this problem, so I'm guessing it's my code. I just have no idea where else to go with debugging it.

@CEWendel
Copy link
Owner

CEWendel commented Jul 9, 2014

Is scrollViewDidScroll: getting called in SWTableViewCell.m?

@thephatp
Copy link
Author

thephatp commented Jul 9, 2014

Yes, scrollViewDidScroll: is getting called. Let's take swipe right to expose left buttons as the example to step through.

It correctly determines that we should "Expose the left button view" (the else part of the first if statement).

It correctly determines that [self leftUtilityButtonsWidth] is in fact > 0.

It verifies that the delegate is set and can respond to the selector swipeableTableViewCell:canSwipeToState: (which always returns YES right now in my implementation of the method).

In updateCellState, the value for frame.size.width is not changing at this line:

  • frame.size.width = CGRectGetWidth(self.frame);
    --> Seems like this is OK.

What is problematic, though, is that self.leftUtilityClipConstraint.constant never changes and is always zero.

Why would that be? Does it have something to do with my cell setup?

@thephatp
Copy link
Author

thephatp commented Jul 9, 2014

I have confirmed that it has something to do with the way I have structured my cell, but I don't know what yet. I tested using a nib file in my project, and that showed the animation with no problem. I then created a dummy prototype cell to make sure it didn't have to do with that, and sure enough, that dummy cell worked just fine.

Do you have any idea from a constraint perspective or some other setting on the cell (which could be set in Interface Builder, b/c I'm not changing anything in code) which could cause the leftUtilityClipConstraint / content of the original view (not cellScrollView) to not move?

@thephatp
Copy link
Author

Wow...talk about a really stupid mistake. In IB, I had set backgroundView Outlet to the contentView.

Sorry for the trouble. Excellent control, BTW! 👍

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

No branches or pull requests

2 participants