Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialMartial Gil
771 PointsI can't put the array after find() (with swift 1st),can you help me please.
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { if segue.identifier == "sehe" { let imageView = sender!.view as! UIImageView if let play = find(playlistArray, imageView){
}
this my code, and Xcode say me that "use an unresolved identifier 'playlistArray'"
2 Answers
Tyler Rolfe
2,882 Pointsthe find() function is not longer supported in Swift 2.0.
Instead try this..
if let index = playlistArray.indexOf(playlistImageView)
Mike Gomes
15,391 PointsThanks Tyler Rolfe!
I was facing the same problem and your solution worked well for me as well :)
Chung-En Hsu
3,761 PointsChung-En Hsu
3,761 PointsThank you very much!!!!!!