TheM4hd1 / SwiftyInsta

Instagram Private API Swift

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Progress during requests

jajosheni opened this issue · comments

Hello, awesome work done in this repo.

I wanted to ask if there is any way to see the progress of the requests.
I.e. while getting followers can I see how many of them are retrieved?
Then compare it to the number of followers retrieved from profile info.

Thank you

You can use the updateHandler parameter on methods such as UserHandler.followed.
It accepts a block as such:

public typealias PaginationUpdateHandler<R, P> = (
        _ update: P,
        _ inserting: [R],
        _ nextParameters: Bookmark,
        _ runningResponse: [R]
    ) -> Void
  • inserting represents the newly fetched Users.
  • runningResponse represents all Users returned until then.