You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My twitter style popup displays a list of 10 items pulled from a 'paged' api. If one the 10 is not the right one then my app needs to show the next 10 items, this is done by querying the API again for page 2. Where is the best place to put this code?
The text was updated successfully, but these errors were encountered:
@rodriar Not sure I understand. I tried adding a dummy item which was meant to close the menu, requery new data then open it up again, but that was really what my question was about. I didn't know where this code should live.
ie the action is this....
actionController.addAction(Action(ActionData(title: "None of the above", subtitle: "", image: tempImg!, uid: "no-id"), style: .default, handler: { action in
- not sure what to write here, to either update the menu with new options, or close the menu requery and then open again
}))
Hey, you cant update the actioncontroller. Use the handler to fetch your data and create a new action controller with the new data and show it
actionController.addAction(Action(ActionData(title: "None of the above", subtitle: "", image: tempImg!, uid: "no-id"), style: .default, handler: { [weak self] action in
let data = self?.fetchData()
let actionController2 = ActionController()
for item in data ?? [] {
actionControlelr.add(Action(<something with item>))
}
}))
Please keep this kind of questions for Stack overflow.
Cheers!
My twitter style popup displays a list of 10 items pulled from a 'paged' api. If one the 10 is not the right one then my app needs to show the next 10 items, this is done by querying the API again for page 2. Where is the best place to put this code?
The text was updated successfully, but these errors were encountered: