Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Swift 3.0 Result of call is unused [duplicate]

Tags:

ios

swift

swift3

You are getting this issue because the function you are calling returns a value but you are ignoring the result.

There are two ways to solve this issue:

  1. Ignore the result by adding _ = in front of the function call

  2. Add @discardableResult to the declaration of the function to silence the compiler