Swift 3.0 Result of call is unused [duplicate] Swift 3.0 Result of call is unused [duplicate] ios ios

Swift 3.0 Result of call is unused [duplicate]


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