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 Object-Oriented Swift 2.0 Complex Data Structures Adding Instance Methods

I'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

structs.swift
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

thks I owe you an other one!

David Lin
David Lin
35,864 Points

You're welcome!

David Lin
David Lin
35,864 Points

In 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)"
    }
}