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


  • 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":
« Last Edit: September 11, 2015, 08:55:48 PM by kjmcneish »