Skip to content

Instantly share code, notes, and snippets.

@uvolchyk
Last active January 30, 2021 21:53
Show Gist options
  • Save uvolchyk/793b5c99fbb5cf51876b1d07aadc058c to your computer and use it in GitHub Desktop.
Save uvolchyk/793b5c99fbb5cf51876b1d07aadc058c to your computer and use it in GitHub Desktop.
struct News {
let title: String
let summary: String
let date: String
}
class ViewData {
private let raw: News
var expanded: Bool
var title: String { raw.title }
var summary: String { raw.summary }
var date: String { raw.date }
init(_ data: News) {
raw = data
expanded = false
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment