Coder Social home page Coder Social logo

Comments (7)

mbigatti avatar mbigatti commented on May 30, 2024

Hi. Are you using accessory views? If so, there is an issue with that that you can workaround with code at #8

from bmxswipablecell.

rrroni avatar rrroni commented on May 30, 2024

No, I'm not, but thanks! I have a button on each cell, and the button takes up the left side of the cell.

I did a workaround:

  1. Subclassed BMXSwipableCell with labels and a button (but that was hopeful thinking, the "button" can just be another view in the cell).
  2. Created a delegate for the subclass and named it something other than "delegate", which is already used in your library. At the TableViewController's cellForRowAtIndexPath, set the cell's delegate = self (i.e. the TVC).
  3. Added a UITapGestureRecognizer to contentView, set its delegate to self (i.e. the cell). The gesture recognizer doesn't work when added to the button or any other view on the cell.
  4. Added target action to the UITapGestureRecognizer.
  5. Set the action to be conditional on the tap occurring where the button is located (CGPoint tapLocation = [gestureRecognizer locationInView:self.contentView];)
  6. The action method calls a delegate method that the TVC executes

Hope that's helpful to someone!

from bmxswipablecell.

mbigatti avatar mbigatti commented on May 30, 2024

I understand correctly, left side? So you're setting the swipe width to full width? The sample project use button on the right as well as my main project. Maybe the issue is related to this particularity.

from bmxswipablecell.

rrroni avatar rrroni commented on May 30, 2024

The button is on the outer cell, not in the basement view. I use the swipe at about the same width as the sample project.

Somehow, the cell doesn't seem to recognize taps on a button placed in the scrollViewContentView.

from bmxswipablecell.

mbigatti avatar mbigatti commented on May 30, 2024

Ok, now I get it. Actually, that case was non tested: I always had output controls on the scrollViewContentView and I focused on getting UITableView native delegate messaging work. I'll take a look at the issue as soon as I have some time, maybe I'll find a way to expand BMXSwipableCell. Thank you.

from bmxswipablecell.

rrroni avatar rrroni commented on May 30, 2024

Yeah, that's what I figured. It's not necessarily core functionality. This library is so great and easy to customize - thanks again for creating it!

from bmxswipablecell.

mbigatti avatar mbigatti commented on May 30, 2024

You're welcome!

from bmxswipablecell.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.