From 0a366bbc4d54bc27c3fc6b06020d34ccee57fd53 Mon Sep 17 00:00:00 2001 From: panupan Date: Tue, 13 Jan 2015 13:05:38 -0500 Subject: [PATCH] Update MRProgressOverlayView.m Was trying to run KiF UI automation tests on a project with MRProgress installed as a CocoaPod and was running into a strange exception. This seems to resolve the issue. --- src/Components/MRProgressOverlayView.m | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Components/MRProgressOverlayView.m b/src/Components/MRProgressOverlayView.m index d20b482..951410f 100644 --- a/src/Components/MRProgressOverlayView.m +++ b/src/Components/MRProgressOverlayView.m @@ -337,8 +337,15 @@ - (UIView *)createModeView { } - (void)setModeView:(UIView *)modeView { + if (_modeView) { + [_modeView removeFromSuperview]; + } + _modeView = modeView; - [self.dialogView addSubview:modeView]; + + if (_modeView) { + [self.dialogView addSubview:_modeView]; + } } - (UIView *)createViewForMode:(MRProgressOverlayViewMode)mode {