Add Observer to BOOL variable

前端 未结 4 1966
半阙折子戏
半阙折子戏 2021-02-08 13:48

Is it possible to add observers to simple variables such as BOOLs or NSIntegers and see when they change?

Thanks!

4条回答
  •  -上瘾入骨i
    2021-02-08 14:36

    Yes; the only requirement is that the object in which those variables occur are key-value compliant for those properties.

提交回复
热议问题