iOS Build a Simple iPhone App with Swift Getting Started with iOS Development Swift Recap Part 1

Test1 RET
Test1 RET
8,264 Points

Name the method description. It takes no parameters and returns a strin

struct Tag {
  let name: String
}

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

    func description () -> String {

  return "\(title) by \(author). Filed under \(tag)"

} 
}

let firstPost = Post(title: "iOS Development", author: "Apple", tag: Tag(name: "swift"))
let postDescription = firstPost.description()
structs.swift
struct Tag {
  let name: String
}

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

    func description () -> String {

  return "\(title) by \(author). Filed under \(tag)"

} 
}

let firstPost = Post(title: "iOS Development", author: "Apple", tag: Tag(name: "swift"))
let postDescription = firstPost.description()

1 Answer

KRIS NIKOLAISEN
KRIS NIKOLAISEN
54,370 Points

You need to use the name property of tag in your return string