Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

iOS Object-Oriented Swift Complex Data Structures Adding Instance Methods

Khaled M
Khaled M
829 Points

I'm stuck, again.

Is there a way to see the solutions?

I end up wasting so much time trying to figure out the problem, when it's something that I was never clearly taught in the first place. I can understand this teaching method if they were to provide the solution if the student has exhausted all options. If this is truly the case, I'm going to cancel my subscription.

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

    func fullName(firstName: String, lastName: String) -> String {
      return(firstName, lastName)
    }
}

1 Answer

Gavin Butler
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Gavin Butler
iOS Development with Swift Techdegree Graduate 15,489 Points

Hi Khaled, Don't give up - I feel the same as you often. I think for this exercise the full name was to contain a space, so the following worked for me (note there is a space between first name & last name below): func fullName() -> String { return "(firstName) (lastName)" }

Hope this helps.