This is the correct answer. contains can be turned into a (String?) -> Bool either by making the argument optional, which is what you did, or by making the array optional. Like, for example:
let contains = ["hello" as _?, "world"].contains // (String?) -> Bool
contains("hello")
Topic:
Programming Languages
SubTopic:
Swift
Tags: