Using Xcode 10.1 running the app on mini iPad OS 12.1.1
I am posting a notification to NotificationCenter and the handler function updates UILabel setupProgress
to show the progress of a data import.
This used to work fine but has recently stopped working, very possibly as a result of something I have done, but I can't think what.
PM
in the code is a function which prints to the console - and it tells me that self.setupProgress.text
is, in fact, set correctly and changes as expected as the data loads, however the corresponding UILabel does not update.
The initial UILabel text is set like this
if !self.update_type.isEmpty && self.update_type == "setup_import" {
self.setupProgress.text = "I've told the server that this is a clean install"
}
and that works fine - but then, as the import progresses, in the handler function (below) I get no updates until
import_progress == "And now the end is upon us ..."
at which point the UILabel updates correctly and everything carries on as expected.
func handleImportNotification(_ notification:Notification) {
self.setupProgress.text = import_progress
// should show something like
// `Importing F4RES : 0 of : 1395`
// `Importing F4RES : 500 of : 1395`
// etc...
PM(#line, function: #function, str1: self.setupProgress.text)
// prints the correct updates to the console
if import_progress == "And now the end is upon us ..." {
self.makeShopOptions()
self.loadingImage.stopAnimating()
self.performSegue(withIdentifier: "setup_to_splash", sender: self)
}
}
The app continues to work just fine - just without the expected UILabel updates in between.
Thanks in advance for any ideas.