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 trial
Andis Slaitas
3,430 Pointsdown casting error: 'ŪIViewController' is not convertible to 'PlaylistDetailViewController'
This is the code:
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
if segue.identifier == "showPlaylistDetail" {
let playlistDetailController = segue.destinationViewController as PlaylistDetailViewControler
}
}
which gives an error: 'ŪIViewController' is not convertible to 'PlaylistDetailViewController'
Xcode 7.0.1
1 Answer
Andis Slaitas
3,430 PointsProblem solved using 'as!'
Richard Lu
20,185 PointsRichard Lu
20,185 PointsI've formatted your code for readability on your code snippet. For future reference, you can embed code like this:
```swift
place your code inside here
```