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 trialJatinder singh saini
Courses Plus Student 191 PointsError editor placeholder in source file
extension Page {
func addChoice(title:String, story: Story) -> Page
{
let page = Page(story: story)
return addChoice(title, page: page)
}
func addChoice(title: String, page :Page) -> Page {
switch (firstChoice ,secondChoice) {
case (.Some, .Some): break
case (.None, .None), (.None, .Some):
firstChoice = (title, page)
case(.Some, .None):
secondChoice = (title, page)
}
return page
m getting error in line return addChoice(title, page: page) }
3 Answers
Gabriel Mititelu
5,881 PointsWhat does it say ?
Boris Likhobabin
3,581 PointsFound on stackoverflow:
Try to delete that line of code and type it again on a new line (not just copy and paste) Worked for me!
Abdulwahab Alansari
15,151 PointsYour code works fine here, all I had to do is adding two close curly brackets at the end }}