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 Complex Data Structures Adding Instance Methods

I don't understand this question.

Hey guys, can someone please explain to me what to do, because I don't really have a clue, what to do. Thanks.

structs.swift
struct Person {
    let firstName: String
    let lastName: String
}

2 Answers

first step;

add an instance method with the name "fullName()" that returns a string

so that would be

func fullName() -> String {
{

and next step:

this method should take the first and last names and return the result with a space in between

to return the string that is being asked you will have to do something like

return thing1 + " " + thing2

What you need to do is make the function that returns the firstName and lastname properties, such as...

```func fullName() -> String { return firstName + "" + lastName }