Closed mpinkston closed 8 years ago
How about like this:
[editor addObserver:self forKeyPath:@"currentTool" options:NSKeyValueObservingOptionNew context:nil];
Thanks @yackle, there you have it. It just didn't click to try observing "currentTool" directly for some reason.
I'm using Swift and RxSwift to set up my observers, so
editor.rx_observe(AnyObject.self, "currentTool").subscribeNext...
does the trick for me.
I appreciate your help.
I'd like to request a way to know when the editor has gone into edit mode; as in when a user selects a tool (unless one already exists, which I've missed).
My use-case scenario is that I've initialized and added a bunch of editors to a UIPageViewController to allow editing multiple images one after another. This works quite well. However, some of the tools have sliders which can be tricky to use when the UIPageViewController's gesture recognizer is still enabled.
I'd like to disable the UIPageViewController's gesture recognizer when a tool has been selected, but am not sure how best to achieve this. Currently I've added a KVO to the navigationBar's "transform" property to watch for this, but that seems messy.
So, what do you think about adding a delegate method that fires when a tool is opened/closed?