Move sentence about bindings to the right section.

This commit is contained in:
Brent Simmons 2018-01-23 21:07:29 -08:00
parent e780391906
commit bc1fe05e91
2 changed files with 12 additions and 1 deletions

View File

@ -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?) {

View File

@ -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 Swifts `didSet` method on accessors.
All notifications must be posted on the main queue.