Problem
I tried UISheetPresentationController
example in Xcode13.0 beta
.
And in order to handle the detent change
event, I implemented the sheetPresentationConstructionSelectedDetentIdentifier(_:)
method, but this method is not called when the size is changed by dragging.
Is this a bug in the Xcode beta
? or is there anything wrong with my implementation?
Here is My code
class ModalViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
if let presentationController = presentationController as? UISheetPresentationController {
presentationController.detents = [.medium(), .large()]
presentationController.delegate = self
}
}
}
extension ModalViewController: UISheetPresentationControllerDelegate {
func sheetPresentationControllerDidChangeSelectedDetentIdentifier(_ sheetPresentationController: UISheetPresentationController) {
/// not called
}
}