gpt4 book ai didi

ios - 3D Touch 卡住了我的应用程序

转载 作者:塔克拉玛干 更新时间:2023-11-02 08:33:45 26 4
gpt4 key购买 nike

也许我的问题等于:

Force Touch animation freezes if gently touched

App is freezing in 'peek and pop' implementation in iPhone 6s

1) 没有“错误”的强制触摸:创建一个 UITransitionView 层来预览我的 View Controller 。效果很好。

enter image description here

2) 用“bug”强制触摸:当我轻轻点击按钮时,创建了 UITransitionView 层,但它是透明的(没有内容),此时我无法与我的应用程序交互(因为顶层是“空的”)。

enter image description here

更新:

代码:

HomeViewController

extension HomeViewController: UIViewControllerPreviewingDelegate {

func previewingContext(previewingContext: UIViewControllerPreviewing, viewControllerForLocation location: CGPoint) -> UIViewController? {
if #available(iOS 9.0, *) {
previewingContext.sourceRect = balanceButton!.bounds
}

let balanceViewController = UIStoryboard.balanceViewController()
balanceViewController.delegate = self
balanceViewController.account = account
balanceViewController.preferredContentSize = CGSize(width: 0.0, height: 118)
navigationController?.preferredContentSize = CGSize(width: 0.0, height: 118)

return balanceViewController
}

func previewingContext(previewingContext: UIViewControllerPreviewing, commitViewController viewControllerToCommit: UIViewController) {
let balanceViewController = viewControllerToCommit as! BalanceViewController
balanceViewController.shouldPresentCompleteMode = true
navigationController?.pushViewController(balanceViewController, animated: true)
}

}

BalanceViewController 上:

@available(iOS 9.0, *)
override func previewActionItems() -> [UIPreviewActionItem] {
let action2 = UIPreviewAction(title: "Últimos 5 dias úteis", style: .Default) { (action, viewController) in
self.delegate?.balanceViewControllerFilterDidSelected(.FiveDays)
}
let action3 = UIPreviewAction(title: "action", style: .Default) { (action, viewController) in
self.delegate?.balanceViewControllerFilterDidSelected(.FiftyDays)
}
let action4 = UIPreviewAction(title: "action", style: .Default) { (action, viewController) in
self.delegate?.balanceViewControllerFilterDidSelected(.ThirtyDays)
}
let action5 = UIPreviewAction(title: "action", style: .Default) { (action, viewController) in
self.delegate?.balanceViewControllerFilterDidSelected(.SixtyDays)
}

return [action2, action3, action4, action5]
}

更新 2:

当我切换到另一个应用程序并切换回我的应用程序时..我的设备会振动并查看,但会再次卡住。

谁能帮帮我?

最佳答案

问题已解决

我找到了解决方案。问题是“冗余的”Peek 和 Pop 注册。我正在注册:

1) 调用registerForPreviewingWithDelegate(self, sourceView: view)viewDidLoad()

2) enter image description here

也许它们相互冲突,为了解决这个问题,我删除了 Storyboard转场。

关于ios - 3D Touch 卡住了我的应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36140716/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com