Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🔀 :: [#142] ModalViewController의 dismiss가 subviews를 눌러도 적용되는 현상 #143

Merged
merged 1 commit into from
Aug 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ final class FilterSelfStudyViewController: BaseStoredModalViewController<FilterS
}

override func setLayout() {
MSGLayout.stackedLayout(self.view, ignoreSafeArea: true) {
SpacerView()

contentView
MSGLayout.buildLayout {
contentView.layout
.horizontal(.toSuperview())
.bottom(.toSuperview())
}

MSGLayout.stackedLayout(self.contentView) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ extension UIGestureRecognizer {
}
}

final class Subscription<G: UIGestureRecognizer, S: Subscriber>: Combine.Subscription
final class Subscription<G: UIGestureRecognizer, S: Subscriber>:
NSObject,
Combine.Subscription,
UIGestureRecognizerDelegate
where S.Input == G, S.Failure == Never {

var subscriber: S?
Expand All @@ -38,7 +41,9 @@ extension UIGestureRecognizer {
self.subscriber = subscriber
self.gestureRecognizer = gestureRecognizer
self.view = view
super.init()
gestureRecognizer.addTarget(self, action: #selector(handle))
gestureRecognizer.delegate = self
view.addGestureRecognizer(gestureRecognizer)
}

Expand All @@ -51,5 +56,12 @@ extension UIGestureRecognizer {
}

func request(_ demand: Subscribers.Demand) { }

func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldReceive touch: UITouch) -> Bool {
guard touch.view == self.view else {
return false
}
return true
}
}
}
Loading