Files
NetNewsWire/Modules/Core/Sources/Core/DisplayNameProvider.swift
2024-07-06 21:07:05 -07:00

30 lines
651 B
Swift

//
// DisplayNameProviderProtocol.swift
// DataModel
//
// Created by Brent Simmons on 7/28/16.
// Copyright © 2016 Ranchero Software, LLC. All rights reserved.
//
import Foundation
extension Notification.Name {
public static let DisplayNameDidChange = Notification.Name("DisplayNameDidChange")
}
/// A type that provides a name for display to the user.
public protocol DisplayNameProvider {
@MainActor var nameForDisplay: String { get }
}
public extension DisplayNameProvider {
@MainActor func postDisplayNameDidChangeNotification() {
NotificationCenter.default.post(name: .DisplayNameDidChange, object: self, userInfo: nil)
}
}