I am converting my code from swift 3 to swift 4 and getting this error in the following code. I am getting this even when I try to use flatmap to flatten an array
Cannot convert value of type 'String' to expected argument type 'String.Element' (aka 'Character')
if favoritedProducts.contains("helloWorld") {}
The below line of code does not return a [String] instead it is a '[String.Element]' How do I convert it to a [String]. If I try to cast it as a [String], it says it will always fail.
let productIDs = allItems.flatMap{$0.productID}