tableviewCell中modal延迟

2018-01-06  本文已影响0人  ML_keyboard

方式一:

func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {

        CFRunLoopWakeUp(CFRunLoopGetCurrent()); // Fixes a bug where the main thread may be asleep, especially when using UITableViewCellSelectionStyleNone

            performSegue(withIdentifier: "identifier", sender: nil)

    }

方式二:

func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {

     DispatchQueue.main.async {

            self.performSegue(withIdentifier: "DetailController", sender: nil)

        }

    }

链接参考资料

上一篇 下一篇

猜你喜欢

热点阅读