mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2024-12-25 09:11:13 +01:00
Create postDisplayNameDidChangeNotification, so that a DisplayNameProvider can post a Notification when its name changes.
This commit is contained in:
parent
6ec2f72443
commit
786138d6e7
@ -8,8 +8,21 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
extension Notification.Name {
|
||||
|
||||
public static let DisplayNameDidChange = Notification.Name("DisplayNameDidChange")
|
||||
}
|
||||
|
||||
|
||||
public protocol DisplayNameProvider {
|
||||
|
||||
var nameForDisplay: String { get }
|
||||
}
|
||||
|
||||
public extension DisplayNameProvider {
|
||||
|
||||
func postDisplayNameDidChangeNotification() {
|
||||
|
||||
NotificationCenter.default.post(name: .DisplayNameDidChange, object: self, userInfo: nil)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user