Skip to content

Commit d611d52

Browse files
committed
refactor: move class reverting to controller
1 parent e819e9d commit d611d52

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

ios/SlackBottomSheet.m

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -180,11 +180,6 @@ - (void)setVisible:(BOOL)visible {
180180
}
181181
self.transitionDuration = [[NSNumber alloc] initWithDouble: 0];
182182
UIViewController *rootViewController = [UIApplication sharedApplication].delegate.window.rootViewController;
183-
UIView* pview = [[[[rootViewController presentedViewController] view] superview] superview];
184-
NSString *s = NSStringFromClass([pview class]);
185-
if ([s isEqualToString:@"reactnativeslackbottomsheet.PossiblyTouchesPassableUIView"]) {
186-
[pview performSelector:NSSelectorFromString(@"makeOldClass")];
187-
}
188183

189184
[[rootViewController presentedViewController] dismissViewControllerAnimated:!self->_isHiding completion:^{
190185
self.transitionDuration = oldTransitionDuration;

ios/UIViewController+PanModalPresenter.swift

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class PossiblyTouchesPassableUIView: UIView {
6464
}
6565
}
6666

67-
@objc func makeOldClass() {
67+
func makeOldClass() {
6868
if self.oldClass != nil {
6969
let oldClassMem = self.oldClass!
7070
self.oldClass = nil
@@ -238,6 +238,13 @@ class PanModalViewController: UIViewController, PanModalPresentable {
238238
}
239239
}
240240

241+
override func viewWillDisappear(_ animated: Bool) {
242+
let pview = view?.superview?.superview!
243+
if (pview is PossiblyTouchesPassableUIView) {
244+
(pview as! PossiblyTouchesPassableUIView).makeOldClass()
245+
}
246+
super.viewWillDisappear(animated)
247+
}
241248
}
242249

243250

0 commit comments

Comments
 (0)