Skip to content

allow duplicate cutout in cell #8

Description

@teonicel

Hi i encountered an issue with the library unfortunately it allows you add multiple cutouts to cell which creates an visual bug by taking the previous cutout into the draw function the solution is below

fileprivate func addCutoutView()
    {
        
        
        var hasCutout: Bool = false
        
        for view in self.subviews {
            if !(view is CutoutView) {
                view.alpha = 0
            } else {
                hasCutout = true
            }
        }
        if !hasCutout {
            let cutout = CutoutView()
            cutout.frame = self.bounds
            cutout.backgroundColor = UIColor.clear
            
            self.addSubview(cutout)
            cutout.setNeedsDisplay()
            cutout.boundInside(self)
            self.ld_setCutoutView(cutout)
        }
        
        
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions