In a global, async closure, I'd like to initialise a UIView
on the main thread. I thought this code would possibly do it, but I get an Analyser warning:
UIView.init(frame:)
must by used from the main thread only.
let view: UIView = { // Line with the warning
DispatchQueue.main.sync {
return UIView()
}
}()