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:
-
Ignore the result by adding
_ =
in front of the function call -
Add
@discardableResult
to the declaration of the function to silence the compiler