String does not have a member named 'indexof'

i want to get the string row index which equals to the selectedgame

Arrays (any Indexable type) has a function called ‘indexOf’ (notice the capital O; Swift is case-sensitive).
selectedGameIndex = games.indexOf(game) should what you want.

1 Like

thank you so much!!!