Giter VIP home page Giter VIP logo

Comments (5)

sund4nce avatar sund4nce commented on August 10, 2024

I try to figure it out at the moment...

let cell: NoMatchCell = tableView.dequeueReusableCellWithIdentifier("NoMatchCell", forIndexPath: indexPath) as NoMatchCell

            var test: MCSwipeCompletionBlock?

            var testView: UIView = UIView(frame: CGRectMake(100, 100, 100, 100))
            cell.setSwipeGestureWithView(testView, color: UIColor.blueColor(), mode: MCSwipeTableViewCellMode.Switch, state: MCSwipeTableViewCellState.State1, completionBlock: test)

            return cell

Is my very very very first test which works. NoMatchCell.swift: class NoMatchCell : MCSwipeTableViewCell

I don't know if you can do something with this.. but I don't need buttons I, just want to display some extra info :)

from mcswipetableviewcell.

beweinreich avatar beweinreich commented on August 10, 2024

Cool thanks! I ended up writing it with this code, and it works pretty well!

    var cell = tableView.dequeueReusableCellWithIdentifier("userCell") as MCSwipeTableViewCell!


   cell.setSwipeGestureWithView(crossView, color: UIColor.colorFromRGB(RED), mode: MCSwipeTableViewCellMode.Switch, state:MCSwipeTableViewCellState.State1, completionBlock: { cell, state, mode in
        self.changeCoffeeScore(coffeeScore!, newValue: NSNumber.numberWithInt(-1))
        return ()
    });

from mcswipetableviewcell.

beweinreich avatar beweinreich commented on August 10, 2024

@BluesM I haven't tested on a iOS 8 device yet. However, I am using Xcode 6 Beta 3, and the adding / deleting of rows with a fetchedresultscontroller works well. Not sure why yours is acting oddly. Perhaps you are deleting the row at index path, but the datasource still contains the object?

from mcswipetableviewcell.

pbrewczynski avatar pbrewczynski commented on August 10, 2024

@beweinreich

"EDIT: Don't read this: It was my mistake, I haven't know we need to delete cell ourself"

I'll remove it since it spreads confusion. You can aloso remove your comment :)

from mcswipetableviewcell.

ethanneff avatar ethanneff commented on August 10, 2024

if anyone else is having problems with using MCSwipeTableViewCells with Swift, a made a demo here https://github.com/ethanneff/iOS-Swift-Swipe-Table-View-Cells

from mcswipetableviewcell.

Related Issues (20)

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.