I have a public function:
public func lastActivityFor(userName: String) -> String { ... }
and later I want to call it as:
OneLastActivity.lastActivityFor("username")
but the last line get error:
Cannot convert value of type 'String!' to expected argument type 'OneLastActivity'
Why it appears if I send to those function String as suggested?(userName: String)
Any ideas how can I fix it? If you want more code, just ask me about.
Just create an instance of your class this way:
let temp = OneLastActivity()
Now you can use it's method:
temp.lastActivityFor("username")
Or you can directly use it this way:
OneLastActivity().lastActivityFor("username")
Hope it helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With