我一直在尝试使用弹出窗口,但出现错误

时间:2019-07-28 13:56:22

标签: ios swift popover

我一直在尝试使用弹出窗口,但是当我尝试运行模拟器时,出现此错误。

这是我的代码

func moreButtonPressed(_ sender: UITapGestureRecognizer, _ senderView: UIView) {

    let vc = UIViewController()
    vc.view.backgroundColor = UIColor.gray
    vc.modalPresentationStyle = .popover

    vc.preferredContentSize = CGSize(width: 400,height: 500)
    let ppc = vc.popoverPresentationController
    ppc?.permittedArrowDirections = .down

    present(vc, animated: true, completion: nil)

    if let pres = vc.presentationController {
        pres.delegate = self as? UIPopoverPresentationControllerDelegate
    }
    self.present(vc, animated: true)
    if let pop = vc.popoverPresentationController {
        pop.sourceView = senderView
        pop.sourceRect = (senderView).bounds
    }

}


extension ChatViewController : UIPopoverPresentationControllerDelegate {
    func adaptivePresentationStyle(for controller: UIPresentationController, traitCollection: UITraitCollection) -> UIModalPresentationStyle {
        return .none
    }
}

这是我得到的错误。

  

ld:警告:找不到选项'-F / Users / danielekhorugue / Library / Developer / Xcode / DerivedData / Swiipev1-bsqtwpqmixlzlfcuzfmmukfxgsxu / Build / Products / Debug-iphonesimulator / Popover'的目录   ld:找不到框架Popover   clang:错误:链接器命令失败,退出代码为1(使用-v查看调用)

0 个答案:

没有答案