AliSoftware / AliSoftware/KeyPathObserver

Inheritence support

オープン
#1 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Objective-C
スター
5
フォーク
2
PR マージ指標
30日以内にマージされた PR はありません

説明

If you observe a given keyPath in a class A, and observe the very same keyPath in a subclass B of the class A, the block set in class B will override the one in class A.

It won't be possible to call the superclass observer block when you override it in a subclass.

_Note that the standard Apple KVO mechanism has the same issue_

**Possible Fix:** associating to the keyPath not directly the blocks to execute but an NSMutableDictionary that holds the blocks for each class in the object's class hierarchy should solve the problem. When trying to call the block, we will search blocks by going bottom to top in the class hierarchy, thus calling the blocks associated with the current class, then its superclass if any, then its supersuperclass, and so on.

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。