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 trialBrianna Brinkley
9,277 PointsObject-Oriented Swift 3:
I don't understand.... what am I doing wrong?
struct Person {
let firstName: String
let lastName: String
func fullName() -> {
return "\(firstName) \(lastName)"
}
}
let aPerson = Person(firstName: "Steve", lastName: "Hunter")
let getFullName = aPerson.fullName()
2 Answers
James J. McCombie
Python Web Development Techdegree Graduate 21,199 PointsHello,
One immediate issue I can see is that you have not declared a type to return in the function despite intending to do so with ->
James
James J. McCombie
Python Web Development Techdegree Graduate 21,199 Pointsok, you need to rename that last constant myFullName rather than getFullName. I cant see anything else wrong.
Brianna Brinkley
9,277 PointsThank you so much!
Brianna Brinkley
9,277 PointsBrianna Brinkley
9,277 PointsI added String after the -> and it's saying "Bummer! Make sure you're adding an instance method named fullName() to the struct definition". I don't fully understand what this means, could you show me or explain in a bit more detail?