iOS App Development Book/Video Series
General Category => FAQs => Topic started by: kjmcneish on September 11, 2015, 08:58:30 PM
-
The contains() method has been removed from Swift 2.0, and has been replaced with the contains() method found on collections instead.
For example, this code in Swift 1.2 and earlier:
let fruit = ["Apple","Orange","Banana"]
let hasApple = contains(fruit, "Apple")
Should be changed to:
let fruit = ["Apple","Orange","Banana"]
let hasApple = fruit.contains("Apple")
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)
Check out our Robot Tic-Tac-Toe app: https://itunes.apple.com/us/app/robot-tic-tac-toe/id990638517?mt=8 (https://itunes.apple.com/us/app/robot-tic-tac-toe/id990638517?mt=8)