swift 中不使用函數傳回值

來源:互聯網
上載者:User

標籤:ack   系統   height   pac   rda   sha   ret   under   result   

在該函數前添加 @discardableResult  即可,例如

@discardableResult func shared() -> (UIView) {

  return view

}

 

以上函數的返回結果不被使用時系統不會發出警告.

swift 中不使用函數傳回值

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.