0

How can I examine a generic swift array contain an element, without converting to NSArray?

if ([1, 2, 4, 5, 6] as NSArray).containsObject(2) {

    return 0
}
0

1 Answer 1

4

There's this function:

contains([1, 2, 4, 5, 6], 1)
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.