24 lines
443 B
Swift
24 lines
443 B
Swift
import Foundation
|
|
|
|
protocol LinkPreviewMetadataProvider {
|
|
|
|
var linkPreview: LinkPreviewMetadata? { get }
|
|
|
|
var title: String { get }
|
|
|
|
var subtitle: String? { get }
|
|
|
|
var description: String { get }
|
|
}
|
|
|
|
extension LinkPreviewMetadataProvider {
|
|
|
|
var linkPreviewTitle: String {
|
|
linkPreview?.title ?? title
|
|
}
|
|
|
|
var linkPreviewDescription: String {
|
|
linkPreview?.description ?? subtitle ?? description
|
|
}
|
|
}
|