我确实支持3D Touch,我这样做,当使用强拉时,单元格出现控制器,然后用户拿起它,他显示了动作,当用户点击它时会有一个按钮显示我想要的,控制器完全打开。如何显示此控制器?
<header class="entry-header">
<h1 class="entry-title">Collections Trainer</h1>
</header>
答案 0 :(得分:2)
我改变了代码
@available(iOS 9.0, *)
override func previewActionItems() -> [UIPreviewActionItem] {
let showAction = UIPreviewAction(title: "Show", style: .Default) { [weak self] (action: UIPreviewAction, vc: UIViewController) -> Void in
guard let weakSelf = self else {
return;
}
if let _popAction = weakSelf.popAction {
_popAction()
}
self?.showViewController(vc, sender: nil)
print("show city controller")
}
let cityController = CityController()
cityController.showPreviewController()
return [showAction]
}