Code Monkey home page Code Monkey logo

Comments (7)

TheM4hd1 avatar TheM4hd1 commented on June 11, 2024

Hello,
Just tested these 2 function, it seems they're working fine.
What's the error you got?

from swiftyinsta.

flamme0011 avatar flamme0011 commented on June 11, 2024

It says EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0)

this is my code

self.mediaItems.forEach({ (media) in

            do {
                
                try self.handler.getMediaLikers(mediaId: media.id!, completion: { (result) in

from swiftyinsta.

TheM4hd1 avatar TheM4hd1 commented on June 11, 2024

Clean build your project, if you added framework manually, try to remove it from General - Linked Libraries and Frameworks and add it again, if you added from pod, just do a clean build.

Note: make sure mediaId is not nil

from swiftyinsta.

flamme0011 avatar flamme0011 commented on June 11, 2024

nope it is not nil. I tried with cleaning project and it worked.
Thanks for your help

from swiftyinsta.

trentona avatar trentona commented on June 11, 2024

@sbertix @TheM4hd1 Do you have a stand alone version of this function that you can share? The auto complete is a little daunting and gives me this.

handler.media.likers(ofMedia: <#T##String#>, with: <#T##PaginationParameters#>, 
updateHandler: <#T##PaginationUpdateHandler<User, AnyPaginatedResponse>? 
##PaginationUpdateHandler<User, AnyPaginatedResponse>?##(AnyPaginatedResponse, [User], 
PaginationParameters, [User]) -> Void#>, completionHandler:   
<#T##PaginationCompletionHandler<User>##PaginationCompletionHandler<User>## 
(Result<[User], Error>, PaginationParameters) -> Void#>)

I assume the permalink goes in for the string but past that Im not sure what to do

from swiftyinsta.

sbertix avatar sbertix commented on June 11, 2024

The first argument is actually the mediaId (as represented in Media.identity.identifier!).
The with PaginationParameters adjusts how many pages of data to load.
updateHandler is called every time a new page is fetched (page is the aggregated data, new is the paginated array of Users, paginationParameters is the next PaginationParameters, all is a concat of all new arrays until then).
completionHandler is only called once at the end returns a Result<[User], Error> result and the following paginationParameters.
@trentona

handler.media.likers(ofMedia: "2145341997261920748", // a random `mediaId` of a random pic on the `Instagram` account.
                     with: PaginationParameters(startingAt: nil, maxPagesToLoad: 1),
                     updateHandler: { page, new, paginationParameters, all in },
                     completionHandler: { result, paginationParameters in })

from swiftyinsta.

trentona avatar trentona commented on June 11, 2024

ok, cool thank you that makes sense. I only have the permalink though, how do I get the mediaId?
@sbertix

from swiftyinsta.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.