Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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,713 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.