I'm getting a weird response from Xcode in trying to use symbolVariant(.contains). I also don't understand why it demands the type cast. What am I doing wrong?
Here's the code as text:
import SwiftUI
let Variants: [SymbolVariants] = [
.circle,
.square,
.fill,
.rectangle,
.slash,
.none
]
func varAvail(_ image: Image) -> [SymbolVariants] {
var res: [SymbolVariants] = []
for variant in Variants {
if image.symbolVariant(.contains(variant)) as! Bool {
res.append(variant)
}
}
}