mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2024-12-19 21:13:22 +01:00
Move sentence about bindings to the right section.
This commit is contained in:
parent
e780391906
commit
bc1fe05e91
@ -43,6 +43,7 @@ import RSCore
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(batchUpdateDidPerform(_:)), name: .BatchUpdateDidPerform, object: nil)
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(faviconDidBecomeAvailable(_:)), name: .FaviconDidBecomeAvailable, object: nil)
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(feedSettingDidChange(_:)), name: .FeedSettingDidChange, object: nil)
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(displayNameDidChange(_:)), name: .DisplayNameDidChange, object: nil)
|
||||
|
||||
outlineView.reloadData()
|
||||
|
||||
@ -101,6 +102,14 @@ import RSCore
|
||||
configureCellsForRepresentedObject(feed)
|
||||
}
|
||||
|
||||
@objc func displayNameDidChange(_ note: Notification) {
|
||||
|
||||
guard let object = note.object else {
|
||||
return
|
||||
}
|
||||
configureCellsForRepresentedObject(object as AnyObject)
|
||||
}
|
||||
|
||||
// MARK: Actions
|
||||
|
||||
@IBAction func delete(_ sender: AnyObject?) {
|
||||
|
@ -112,12 +112,14 @@ Stack views are not allowed in table and outline view cells, but they can be use
|
||||
|
||||
Use nil-targeted actions and the responder chain when appropriate.
|
||||
|
||||
Use Cocoa bindings extremely rarely — for a checkbox in a preferences window, for instance. `NSArrayController` and similar are never used. Binding via code is also not done.
|
||||
Use Cocoa bindings extremely rarely — for a checkbox in a preferences window, for instance.
|
||||
|
||||
### Notifications and Bindings
|
||||
|
||||
Key-Value Observing (KVO) is entirely forbidden. KVO is where the crashing bugs live. (The only possible exception to this is when an Apple API requires KVO, which is rare.)
|
||||
|
||||
`NSArrayController` and similar are never used. Binding via code is also not done.
|
||||
|
||||
Instead, we use NotificationCenter notifications, and we use Swift’s `didSet` method on accessors.
|
||||
|
||||
All notifications must be posted on the main queue.
|
||||
|
Loading…
Reference in New Issue
Block a user