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 Swift 2.0 Protocols Creating Flexible Objects Using Protocols Protocol Inheritance

boris said
boris said
3,607 Points

I am having error where print statement won't work. Please help!

Here is my code:

protocol Printable {

func description() -> String

}

struct User: Printable {

let name: String

let age: Int

let address: String

func description() -> String {

    return "\(name), \(age), \(address)"
}

}

let user = User(name: "Boris", age: 12, address: "Some address")

print.(user.description())

2 Answers

I don't know why, but there's a period between the word print and (user.description()). Try getting rid of that period :)

Good luck!

Hope this helps, Alex

boris said
boris said
3,607 Points

Thanks for your help!