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 Build a Simple iPhone App with Swift 2.0 Getting Started with iOS Development Swift Recap Part 1

Brian Hale
Brian Hale
525 Points

cant get past a challenge

im a new user trying to get through some of this. Im looking for one course in swift to teach me right from the beginning and cant find it. I have started with :Build a Simple iPhone App" and it wont let me past one of the challenges.

Looking for help ASAP!

structs.swift
struct Tag {
    let name: String
}

struct Post {
  let title: String
  let author: String
  let tage: Tag

  }

1 Answer

Paul Brazell
Paul Brazell
14,371 Points

Almost there! All you have to do from this point is just create the instance of the Post struct and assign it to the constant firstPost. Remember that your tag property of the Post struct is of type Tag, so you have to either initialize it before creating the instance, or you can do it inline like I've done here. Hope this helps!

struct Tag {
    let name: String
}

struct Post {
    let title: String
    let author: String
    let tag: Tag

}

let firstPost = Post(title: "title", author: "author", tag: Tag(name: "tag"))
Brian Hale
Brian Hale
525 Points

Is there a section before this i should take? Swift for beginners maybe?

Brian Hale
Brian Hale
525 Points

the next challenge is over my head. Is there a way to skip the challenges? Thanks for the help!