-1

我试图添加 UISheetPresentationController 但它给出了错误。请帮我解决这个问题。谢谢在此处输入图像描述

func showBasketListView() {
        let basketListView = BasketListViewController()
        let nav = UINavigationController(rootViewController: basketListView)
        nav.modalPresentationStyle = .formSheet
        if let sheet = nav.sheetPresentationController {
            sheet.detents = [.medium()]
            sheet.largestUndimmedDetentIdentifier = .medium
        }
        present(nav, animated: true, completion: nil)
    }
4

0 回答 0