Files
NetNewsWire/RSCore/Sources/RSCore/Shared/DisplayNameProvider.swift

30 lines
629 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 {
var nameForDisplay: String { get }
}
public extension DisplayNameProvider {
func postDisplayNameDidChangeNotification() {
NotificationCenter.default.post(name: .DisplayNameDidChange, object: self, userInfo: nil)
}
}