GithubHelp home page GithubHelp logo

Comments (7)

alexbuga avatar alexbuga commented on May 19, 2024

I think I'll need to tinker with var actionsView: SwipeActionsView? from the SwipeTableViewCell

from swipecellkit.

mohsinalimat avatar mohsinalimat commented on May 19, 2024

Hello,

SwipeActionsView.swift file

implement like below lines...

func addButtons(for actions: [SwipeAction], withMaximum size: CGSize) {
subviews.forEach { $0.removeFromSuperview() }

    for action in actions {
        let actionButton = SwipeActionButton(frame: CGRect(origin: CGPoint(x: 0, y: size.height/2-30), size: CGSize(width: size.width * 2, height: 60)), action: action)
        addSubview(actionButton)
        
        actionButton.addTarget(self, action: #selector(actionTapped(button:)), for: .touchUpInside)
        
        minimumButtonWidth = max(minimumButtonWidth, actionButton.preferredWidth)
        
        switch self.orientation {
        case .left:
            let maskPAth1 = UIBezierPath(roundedRect: actionButton.bounds,
                                         byRoundingCorners: [.topRight , .bottomRight],
                                         cornerRadii:CGSize(width: 30, height:  30))
            let maskLayer1 = CAShapeLayer()
            maskLayer1.frame = actionButton.bounds
            maskLayer1.path = maskPAth1.cgPath
            actionButton.layer.mask = maskLayer1
        case .right:
            let maskPAth1 = UIBezierPath(roundedRect: actionButton.bounds,
                                         byRoundingCorners: [.topLeft , .bottomLeft],
                                         cornerRadii:CGSize(width: 30, height:  30))
            let maskLayer1 = CAShapeLayer()
            maskLayer1.frame = actionButton.bounds
            maskLayer1.path = maskPAth1.cgPath
            actionButton.layer.mask = maskLayer1
        }
    }
}

from swipecellkit.

alexbuga avatar alexbuga commented on May 19, 2024

Well I wanted a clean way of accessing the view from my controller, not to tinker with SwipeCellKit code.
That's what I did eventually. Modified the actionView 'cuz that's what I needed.

from swipecellkit.

jerkoch avatar jerkoch commented on May 19, 2024

Hey @alexbuga - Good to hear you managed to get it working. Any chance you can share a sample project?

I've haven't had a chance think about the best way of accommodating this... maybe it's as simple as exposing the SwipeActionsView. Since the actionView extends outside of the cell bounds, I'm not clear how you got the rounded corners all around.

from swipecellkit.

alexbuga avatar alexbuga commented on May 19, 2024

from swipecellkit.

kurabi avatar kurabi commented on May 19, 2024

This work is not in scope for now but I will welcome pull requests to support something like this.

from swipecellkit.

 avatar commented on May 19, 2024

@alexbuga
I want to talk to you about how to do this round in this ActionButton plz !

from swipecellkit.

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.