iOS App Development Book/Video Series

General Category => FAQs => Topic started by: kjmcneish on September 11, 2015, 05:10:18 AM

Title: Fixing the "find is unavailable; call the indexOf() method" error in Swift 2.0
Post by: kjmcneish on September 11, 2015, 05:10:18 AM
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 (https://itunes.apple.com/us/book/learn-to-code-in-swift/id942956811?mt=11)