Skip to content

Instantly share code, notes, and snippets.

@trotnic

trotnic/Data.swift

Last active Jan 30, 2021
Embed
What would you like to do?
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