Author Topic: Fixing the "find is unavailable; call the indexOf() method" error in Swift 2.0  (Read 5307 times)

kjmcneish

  • Administrator
  • *****
  • Posts: 719
    • View Profile
Swift 2.0 no longer supports the find() free function. You can use the indexOf() method on a collection instead.

For example, you can change this code:

Code: [Select]
let index = find(tempBundleList, themeBundleEntity!)
To this:

Code: [Select]
let index = tempBundleList.indexOf(themeBundleEntity!)
All the best!
Kevin McNeish
Author of "Learn to Code in Swift": https://itunes.apple.com/us/book/learn-to-code-in-swift/id942956811?mt=11
« Last Edit: September 11, 2015, 08:55:48 PM by kjmcneish »