"Expression of type "UIViewController?" is unused".

来源:互联网 发布:手机签名设计软件 编辑:程序博客网 时间:2024/05/20 06:07

func backVC(){

    self.navigationController?.popViewController(animated:true)

}

运行时的时候报警告"Expression of type "UIViewController?" is unused".

主要是swift2都有一个默认可以废弃的结果


在swift3.0情况下修改方式如下

func backVC(){

    _ = self.navigationController?.popViewController(animated:true)

}


1 0