mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2024-12-16 19:35:48 +01:00
23 lines
498 B
Swift
23 lines
498 B
Swift
//
|
|
// MarkCommandValidationStatus.swift
|
|
// NetNewsWire
|
|
//
|
|
// Created by Brent Simmons on 2/17/18.
|
|
// Copyright © 2018 Ranchero Software. All rights reserved.
|
|
//
|
|
|
|
import Foundation
|
|
|
|
enum MarkCommandValidationStatus {
|
|
|
|
case canMark, canUnmark, canDoNothing
|
|
|
|
static func statusFor(_ articles: ArticleArray, _ canMarkTest: ((ArticleArray) -> Bool)) -> MarkCommandValidationStatus {
|
|
|
|
if articles.isEmpty {
|
|
return .canDoNothing
|
|
}
|
|
return canMarkTest(articles) ? .canMark : .canUnmark
|
|
}
|
|
}
|