Doubt to count how many times an arrangement in swift is repeated

0

Good evening I'm just in swift studying and I try to tell for example the word Beach with a for in but it does not work for me .. Thanks

    
asked by S.Figueroa 27.07.2018 в 02:58
source

1 answer

0

Do not count on the for. Swift has better things. You search for the word and then the accounts

let hay = tripDestinationVotes.filter({$0 == .beach}).count
    
answered by 27.07.2018 / 08:48
source