private void AddViewObservers() { _observer = new KVOObserver(); _kvoController = FBKVOController.ControllerWithObserver(_observer); _kvoController.Observe(View, "frame", NSKeyValueObservingOptions.OldNew, CallbackFromKVO); _kvoController.Observe(View.Layer, "bounds", NSKeyValueObservingOptions.OldNew, CallbackFromKVO); }
private void RemoveViewObservers() { if (_kvoController != null) { _kvoController.UnobserveAll(); _kvoController.Dispose(); _kvoController = null; } if (_observer != null) { _observer.Dispose(); _observer = null; } }