ios - how to show view controller from UIPreviewAction in swift -


i support 3d touch, did when using strong pulled cell appeared controller , user picked up, shown action, there button show want when user clicks on it, controller opens. how can show controller?

 @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")     }      return [showaction] } 

i changed code

 @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] } 

Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -