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 Declaring a Struct

Object oriented

let Value: (name : String, age : String) = (0,0) Value Struct User { let name: String let age: String } let User = User (x: 0, y:0)

structs.swift
// Enter your code below
let Value: (name : String, age : String) = (0,0)
Value 
Struct User {
let name: String
let age: String
}
let User = User (x: 0, y:0)

Hi Pema,

Your Struct definition is case sensitive and should be lower case, also you should double check your age constant type within the User struct.

Hope that helps you get on your way :)

1 Answer

Joshua Hawthorne
Joshua Hawthorne
18,523 Points

Hi Pema,

I'm not sure exactly what you're trying to do, but I'll show you the proper syntax below. Compare the capitalization in your code compared to mine. Remember to use camelCase when creating constants (let) and variables (var), and to capitalize structs and classes.

struct User {
    let name: String
    let age: String
}


let user = User(name: "yourName", age: 29)

let value: User = User(name: "anotherName", age: 23)