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

iOS Build an Interactive Story App with Swift Creating a Story Story Segments as Enum Members

Louis Sankey
Louis Sankey
22,595 Points

UIImage ReturnTrip in Assets folder is unresolved in extension Story{};

import UIKit

enum Story { case returnTrip case touchDown case homeward case rover case cave case crate case monster case droid case home }

extension Story{

var artwork: UIImage{
    switch self {
    case .returnTrip: return ReturnTrip
        <#code#>
    default:
        <#code#>
    }
}

}

I'm trying to add the ReturnTrip UIImage like in the video, but ReturnTrip is underlined. The images are in the assets folder and the cover image worked in the previous video. I assumes its something to do with the Story.swift not being properly incorporated with the rest of the project, but I'm new to Xcode so don't know exactly how to figure that out.

Any help is appreciated. Thanks

1 Answer

Clinton Johnson
Clinton Johnson
28,714 Points

Louis Sankey , Hey how are you doing? So to answer your question the code in the video lesson are using Xcode version 8. Please check to see what version you are working because that in which he is using is a String Literal, and is a feature added in Xcode 8.