-3

When i opened my app today, Xcode asked if i wanted to update some syntax. I followed through the update prompts and after all was said and done my app now has this error on one of the "find" methods. Ive been scratching my head over this one for about an hour now. Any advice on what might have changed?

Error

Dustin Spengler
  • 5,478
  • 4
  • 28
  • 36

2 Answers2

1

As discussed here, Swift 2.0 removed the find method and replaced it with indexOf (as indicated by the error Xcode is giving you).

You can fix your code as follows:

if let index = playlistArray.indexOf(playlistImageView)
Community
  • 1
  • 1
Adam S
  • 16,144
  • 6
  • 54
  • 81
0

Read the error message carefully. It says

find(haystack, needle) is unavailable, call haystack.indexOf(needle)

vadian
  • 274,689
  • 30
  • 353
  • 361