How can I update the datasource array for a tableview when the back button is tapped on a second view?
I didnt see how to use seques/prepare/unwind on this case. I tried UINavigationControllerDelegate too and had no success.
Scenario:
First VC has a tableview with invoices information. When tap on a cell it shows a second VC with a particular invoice information.
Second VC has an action to make payment. When tap on make payment it shows a third VC (a modal).
After tapping make payment on the third VC, it return to the second VC (unwind). It works.
When Im back on the second VC, there is a back button (< Invoices) that I would like to go back to the first VC(invoices). Going back works. The problem is that I need to update the datasource when taping back on the navigation bar.
Save button works too. It updates the datasource (segues/unwind)
VC1 members:
var invoices = [Invoice]()
var client: Client?
var invoice: Invoice?
var filteredInvoices = [Invoice]()
VC2 members:
var invoice: Invoice?
var client: Client?
var invoiceItems : [InvoiceItem] = [InvoiceItem]()
VC3 members:
var amountPaid: Decimal = 0.00
var totalInvoice: Decimal = 0.00
var dateTransaction: String? = nil
var invoice: Invoice?