Skip to content

Fails in Extension to NSView #66

@dr2050

Description

@dr2050

Example of an NSView Category:

extension NSView {
    func sizeToFillSuperview() {
        layout(self) { view in
            view.size == view.superview!.size; return
        }
    }
}

Swift Compiler Error is "extra argument in call"

Early substitution for self doesn't help, nor does anything else I've thought of.

Obviously a global function like this is okay, but not ideal:

func sizeToFillSuperview(view: NSView) {
    layout(view) { box in
        box.size == box.superview!.size; return
    }
}

THANKS!

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