-
Currently I'm trying to use Swiftagram 5.0.3 I've read README, Example code and past issues, but finally I couldn't get it how to fetch medias by using specific tag like "travel". Could you give me example code? |
Beta Was this translation helpful? Give feedback.
Answered by
sbertix
May 13, 2021
Replies: 1 comment
-
Hey @karorox, I've moved this to the Discussions tab as this is not an issue, please make sure you're starting support requests from there next time 😊 You can fetch tag-specific posts like so: // Assuming you already have the `Secret`.
let secret: Secret = /* some `Secret` */
// Assuming this is the name of the tag.
let tag: String = "travel"
// Assuming this is retained.
var bin: Set<AnyCancellable> = []
Endpoint.tag(tag)
.posts
.recent // or use `.top` for top posts.
.unlock(with: secret)
.session(.instagram) // or pass your custom `URLSession`.
.pages(1) // to only fetch the first page.
.sink(receiveCompletion: { _ in }, receiveValue: { print($0) })
.store(in: &bin) |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
sbertix
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey @karorox,
I've moved this to the Discussions tab as this is not an issue, please make sure you're starting support requests from there next time 😊
You can fetch tag-specific posts like so: