1
0
mirror of https://github.com/mastodon/mastodon-ios.git synced 2024-12-16 10:48:49 +01:00
mastodon-app-ufficiale-ipho.../MastodonSDK/Sources/MastodonCore/Persistence/Protocol/MastodonFieldContainer.swift

26 lines
583 B
Swift

//
// MastodonFieldContainer.swift
// MastodonFieldContainer
//
// Created by Cirno MainasuK on 2021-8-18.
// Copyright © 2021 Twidere. All rights reserved.
//
import Foundation
import CoreDataStack
import MastodonSDK
public protocol MastodonFieldContainer {
var fields: [Mastodon.Entity.Field]? { get }
}
extension MastodonFieldContainer {
public var mastodonFields: [MastodonField] {
return fields.flatMap { fields in
fields.map { MastodonField(field: $0) }
} ?? []
}
}
extension Mastodon.Entity.Account: MastodonFieldContainer { }