ios - Get indexPath for at Point when scrolling tableView -
i want cell on pressed when preview (uiviewcontrollerpreviewing), problem location returns method on view , not on actual position of cell when scrolling in tableview. i'm trying this:
func previewingcontext(_ previewingcontext: uiviewcontrollerpreviewing, viewcontrollerforlocation location: cgpoint) -> uiviewcontroller? { let mainstoryboard: uistoryboard = uistoryboard(name: "taskdetail", bundle: nil) guard let detailviewcontroller = mainstoryboard.instantiateviewcontroller(withidentifier: "detailtaskviewcontroller") as? detailtaskviewcontroller else { return nil } guard let indexpath = self.listtasksuitableview.indexpathforrow(at: location) else { return nil } print(indexpath.row) }
this return indexpath of eg 2, when scroll row 18
Comments
Post a Comment