Impressia/Vernissage/CoreData/StatusData+Attachments.swift

20 lines
427 B
Swift
Raw Normal View History

2023-01-03 14:09:22 +01:00
//
// https://mczachurski.dev
// Copyright © 2023 Marcin Czachurski and the repository contributors.
// Licensed under the MIT License.
//
import Foundation
extension StatusData {
func attachments() -> [AttachmentData] {
2023-02-07 10:20:24 +01:00
guard let attachments = self.attachmentsRelation else {
return []
}
return attachments.sorted(by: { lhs, rhs in
lhs.id < rhs.id
})
2023-01-03 14:09:22 +01:00
}
}