Skip to content

Can't clear group content #93

@zapletnev

Description

@zapletnev
class TestView: MacawView {
   required init?(coder aDecoder: NSCoder) {
        let ellipse = Ellipse(cx: w/2 - 80, cy: 110, rx: 60, ry: 60)
        let shape = Shape(
            form: Arc(ellipse: ellipse, extent: 2 * M_PI),
            fill: Color.black,
            stroke: Stroke(fill: Color(val: 0x744641), width: 8)
        )
        let contentGroup = Group(contents: [shape])
        contentGroup.onTap { tapEvent in
            contentGroup.contents = []
            print("Cleared!")
        }

        super.init(node: contentGroup, coder: aDecoder)
    }
}

Group content remains after receiving tap event.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions