Warning: Attempt to present on <…> which is already presenting (null)

后端 未结 4 965
孤城傲影
孤城傲影 2021-02-07 02:00

I have a long press gesture set on a UITableView that presents a UIAlertController containing the cell\'s text. When the UIAlertController

4条回答
  •  無奈伤痛
    2021-02-07 02:43

    You should differentiate the gesture state then execute the code you want, if not the selector you add to target will be executed first time when the gesture's state is UIGestureRecognizerStateBegan and second time when the gesture's state is UIGestureRecognizerStateCancelled, the second performance, alertController is showing, so Xcode will log warning.

提交回复
热议问题