|
@@ -333,6 +333,11 @@ typedef NS_ENUM(NSUInteger, FLEXExplorerMode) {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
|
|
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
|
|
|
|
|
+{
|
|
|
|
|
+ [self updateOverlayAndDescriptionForObjectIfNeeded:object];
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+- (void)updateOverlayAndDescriptionForObjectIfNeeded:(id)object
|
|
|
{
|
|
{
|
|
|
NSUInteger indexOfView = [self.viewsAtTapPoint indexOfObject:object];
|
|
NSUInteger indexOfView = [self.viewsAtTapPoint indexOfObject:object];
|
|
|
if (indexOfView != NSNotFound) {
|
|
if (indexOfView != NSNotFound) {
|
|
@@ -352,6 +357,13 @@ typedef NS_ENUM(NSUInteger, FLEXExplorerMode) {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+- (void)updateOverlaysForAllTrackedViews
|
|
|
|
|
+{
|
|
|
|
|
+ for (UIView *view in self.observedViews) {
|
|
|
|
|
+ [self updateOverlayAndDescriptionForObjectIfNeeded:view];
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
|
|
|
#pragma mark - Toolbar Buttons
|
|
#pragma mark - Toolbar Buttons
|
|
|
|
|
|
|
@@ -791,7 +803,18 @@ typedef NS_ENUM(NSUInteger, FLEXExplorerMode) {
|
|
|
|
|
|
|
|
self.previousKeyWindow = nil;
|
|
self.previousKeyWindow = nil;
|
|
|
|
|
|
|
|
- [self dismissViewControllerAnimated:animated completion:completion];
|
|
|
|
|
|
|
+ // If any changes were made to view frames while a modal was presented, they may be off since the frame conversion seemingly breaks when
|
|
|
|
|
+ // a modal is presented. Just in case, update all of the overlays to make sure they match up with their underlying views.
|
|
|
|
|
+ // We want to do this any time we dismiss a modal, regardles of which modal, so that's why it lives in the commmon dismiss method.
|
|
|
|
|
+ void (^commonCompletion)(void) = ^() {
|
|
|
|
|
+ if (completion) {
|
|
|
|
|
+ completion();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ [self updateOverlaysForAllTrackedViews];
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ [self dismissViewControllerAnimated:animated completion:commonCompletion];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@end
|
|
@end
|