mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
30 lines
651 B
Swift
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)
|
|
}
|
|
}
|