scenee / FloatingPanel

A clean and easy-to-use floating panel UI component for iOS
MIT License
5.61k stars 509 forks source link

dismissalTapGestureRecognizer dont work when panel attached to window #590

Closed CaramelHeaven closed 1 year ago

CaramelHeaven commented 1 year ago

Example code

            let fpc = FloatingPanelController()
            fpc.backdropView.dismissalTapGestureRecognizer.isEnabled = true
            fpc.delegate = self
            fpc.contentInsetAdjustmentBehavior = .always
            fpc.set(contentViewController: contentVC)

            let window = UIApplication.shared.windows.first
            window?.addSubview(fpc.view)

            fpc.view.snp.makeConstraints { make in
                make.top.left.right.bottom.equalToSuperview()
            }

            fpc.show(animated: true)

Can we add option to handle gesture when we use window ? )

scenee commented 1 year ago

The library doesn't expect this use case but I fixed this issue locally and I'm going to make a pull request. Thanks.