Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Syntax error while adding a filter to pre-exisiting filter in a fill layer using NSCompoundPredicate #16667

@alankritsingh

Description

@alankritsingh

Hi, I have a fillLayer which already has some filter and I want to add a new filter to this FillLayer using NSCompoundPredicate but I'm facing an issue.

let filter = NSPredicate(format: "\"prop\" == %@", "val")
fillLayer.predicate = NSCompoundPredicate(andPredicateWithSubpredicates: [fillLayer.predicate, filter])

Here fillLayer is of type MGLFillStyleLayer.
The second line throws the following error:
Cannot convert value of type 'NSPredicate?' to expected element type 'Array<NSPredicate>.ArrayLiteralElement' (aka 'NSPredicate')
Any help is appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions