Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

174
Vistas
WidgetKit (Intent) - How to link multiple dynamic intents fetched from remote?

I'm creating a widget for my application and successfully added intent configuration with dynamic data that I got from API.

This snippet gets the list and returns it to Intent:

func provideLeagueOptionsCollection(for intent: LeagueConfigurationIntent,
                                  with completion: @escaping (INObjectCollection<LeagueType>?, Error?) -> Void) {
    
    request(for: Leagues.self, completion: { leagueList in
        
        let leagues = leagueList as! Leagues
        
        let activeLeagues = leagues.leagueList.map { (league: League) -> LeagueType in
            LeagueType(identifier: league.id,
                       display: league.name)
        }
        
        let collection = INObjectCollection(items: activeLeagues)
        
        completion(collection, nil)
    })
}

What I want to add is, when the user selects anything from this list, I want to show another option to select, it goes something like that:

  1. User selects League.
  2. Intent fetches Teams data from API with League's id provided on selection before and team list selection gets visible.
  3. User selects a team from the second list.
  4. Intent returns this data to IntentTimelineProvider -> getTimeline()
  5. The widget shows the selected team's stats.

I tried to debug step-by-step, but after the first selection, none of these ConfigurationIntentHandling functions gets called.

func provideTeamOptionsCollection(for intent: TeamConfigurationIntent, with completion: @escaping (INObjectCollection<TeamType>?, Error?) -> Void) { ... } 

func provideLeagueOptionsCollection(for intent: LeagueConfigurationIntent,
                                      with completion: @escaping (INObjectCollection<LeagueType>?, Error?) -> Void) { ... }
// This method only gets called when interacted with League opiton in configuration view (not after selection from data list).

override func handler(for intent: INIntent) -> Any { return self } 
// This method only gets called when the configuration menu shows up.

My goal is to filter teams from a selected league, so the user won't have to scroll through a long list of teams.

Also open for another suggestions beside this approach.

over 4 years ago · Santiago Trujillo
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda