1

I am creating a light twitter client for iOS using the Swifter library ... I've been able to use other functions in the library fine, but when I use the getBlockedUsers function, nothing happens (or I am doing it wrong). This is how i call the function:

swifter?.getBlockedUsers(includeEntities: false, skipStatus: true, cursor: "", success: mySuccess as? Swifter.CursorSuccessHandler, failure: failureHandler)

and this is what my success handler looks like:

let mySuccess: (JSON, String, String) -> Void = { someJson, someString, anotherString in print("some array: ", someJson)
print("some array: ", someString)
print("some array: ", anotherString)}

After this....nothing is printed to the console. What am I doing wrong? Thank you

Ben Akin
  • 167
  • 2
  • 15
  • Could you clarify - you are saying you want to block/report user but your are asking about `getBlockedUsers` method for which I see in the source code following description `Returns a collection of user objects that the authenticating user is blocking`. Did you mean `blockUser` method instead? – Peter Pajchl Dec 14 '18 at 08:31
  • @PeterPajchl sorry I meant how do I use the getBlockedUsers function. I updated the question – Ben Akin Dec 14 '18 at 08:34
  • One thing I see is that your success handler does not have same signature as in their code. `(JSON, _ previousCursor: String?, _ nextCursor: String?) -> Void` notice that prev/next cursors are optionals. – Peter Pajchl Dec 14 '18 at 08:43
  • @PeterPajchl so should i write it as `let mySuccess: (JSON, String?, String?)...` instead? Sorry, I'm newish to Swift – Ben Akin Dec 14 '18 at 08:47
  • That is correct. – Peter Pajchl Dec 14 '18 at 09:02
  • @PeterPajchl it still didnt work smh. This is what printed out: `some array: Optional([]) some array: Optional("0") some array: Optional("0")` any suggestions? – Ben Akin Dec 14 '18 at 20:50

0 Answers0