metatext-app-ios-iphone-ipad/ViewModels/Sources/ViewModels/View Models/CardViewModel.swift

23 lines
406 B
Swift
Raw Normal View History

2020-09-29 03:14:43 +02:00
// Copyright © 2020 Metabolist. All rights reserved.
import Foundation
import Mastodon
public struct CardViewModel {
private let card: Card
init(card: Card) {
self.card = card
}
}
public extension CardViewModel {
2021-03-29 08:04:14 +02:00
var url: URL { card.url.url }
2020-09-29 03:14:43 +02:00
var title: String { card.title }
var description: String { card.description }
2021-03-29 08:04:14 +02:00
var imageURL: URL? { card.image?.url }
2020-09-29 03:14:43 +02:00
}