Code Monkey home page Code Monkey logo

dnsswipeabletablecell's Introduction

DNSSwipeableTableCell


DNSSwipeableTableCell demo

This is an extension of a tutorial I've written for RayWenderlich.com on how to create a swipeable UITableViewCell for iOS 7 without driving yourself completley insane with UIScrollViews. (Drive yourself insane with constraints instead!)

The crux of the problem is that while adding a delete button is super-easy, adding a delete button AND another button is a total nightmare because of the way the cells are constructed.

I've refactored the code that was included in the tutorial, which is is more meant as an exercise in helping n00bs dive into figuring out how Apple's code works under the hood, into this library, which I'm hoping will be helpful for anyone dealing with this in production code.

##The Biggest Changes

  • Removed dependency on the storyboard
  • Made the myContentView public so the cell could be subclassed and recycled more easily.
  • Beefed up delegate to handle an arbitrary number of buttons
  • Added datasource to allow tons of user-configurable options
  • Tweaked the animation so it uses spring damping instead of trying to do that manually
  • Added a ton of documentation to the swipeable cell class
  • Cleaned up the sample app quite a bit
  • Added a sample subclass.
  • Added a bunch of photos of my cat, because the internet loves cats.

##//TODOs

  • Add CocoaPods support
  • Figure out a way to not have to store the index path on the cell itself. It's way easier, but it feels dirty. (I know, I know)
  • ??? - File an issue!

##Photos All photos Copyright Ellen Shapiro. If you want to see more photos of my jerkface cat, Chaplin, follow me on Instagram.

dnsswipeabletablecell's People

Contributors

designatednerd avatar

Watchers

 avatar  avatar

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.