I'm doing a network request twice, in the view controllers connected to a tab bar. If I can do the network request directly in the tab bar controller, I can pass the data from there in just one network request.
I tried this but it is giving a lot of errors. - var pages : [page] = [] is an array of structs that I want to pass. It is working fine, I just need to figure out the passing part.
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
let feedVC = segue.destination as! FeedViewController
let categoriesVC = segue.destination as! CategoriesGridViewController
feedVC.pages = pages as! [[String:Any]]
categoriesVC.pages = pages [[String:Any]]
}
I fetch from a database of images and their information. I make an array of structs and use that to display the data in the App. All of that is working fine. Page -
struct page {
var urlsArray : [String]
var caption : String
var title : String
var time : String
}