metatext/ViewModels/Sources/ViewModels/View Models/AttachmentsRenderingViewModel.swift
2021-01-25 15:15:30 -08:00

24 lines
838 B
Swift

// Copyright © 2020 Metabolist. All rights reserved.
import Foundation
public protocol AttachmentsRenderingViewModel {
var attachmentViewModels: [AttachmentViewModel] { get }
var shouldShowAttachments: Bool { get }
var shouldShowHideAttachmentsButton: Bool { get }
var sensitive: Bool { get }
var canRemoveAttachments: Bool { get }
func attachmentSelected(viewModel: AttachmentViewModel)
func removeAttachment(viewModel: AttachmentViewModel)
func toggleShowAttachments()
}
public extension AttachmentsRenderingViewModel {
var shouldShowAttachments: Bool { true }
var shouldShowHideAttachmentsButton: Bool { false }
var sensitive: Bool { false }
var canRemoveAttachments: Bool { false }
func removeAttachment(viewModel: AttachmentViewModel) {}
func toggleShowAttachments() {}
}