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 trialjc laurent
6,351 PointsI've add the Strut to the instance but....
that's what I got: Make sure you're adding an instance method named getFullName() to the struct definition
struct Person {
let firstName: String
let lastName: String
func getFullname(firstName: String,lastName: String) -> (String) {
let FullName = Person(firstName: firstName, lastName: lastName)
return(FullName)
}
}
2 Answers
jc laurent
6,351 Pointsthks I owe you an other one!
David Lin
35,864 PointsIn your solution, FullName is a Person struct, but it only needs to be a string which consists of the first and last name parameters.
Something like this:
struct Person {
let firstName: String
let lastName: String
func getFullName() -> String {
return "\(firstName) \(lastName)"
}
}
David Lin
35,864 PointsDavid Lin
35,864 PointsYou're welcome!