title: asynchronous initialisation with swiftui
body: <p>Basically - I run up against this a lot - I don't understand how you correctly do asynchronous initialisation in swift with callbacks. (with combine - I can do it). In particular - I have this code:</p>
  <pre class="lang-swift prettyprint-override"><code>struct MyView : View {
      @State var initialised : Bool = false
  
      init()
      {
         var initialisedBinding = $initialised
         Photos.PHPhotoLibrary.RequestAuthorization {
            status in 
            if (status == Photos.PHAuthorizationStatus.authorized) {
                print(&quot;here I am&quot;)
                initialisedBinding.wrappedValue = true
                initialisedBinding.update()
            }
        }
     }
  
     var body : some View {
       VStack {
         if (initialised) {
             Text(&quot;yep&quot;)
         } else {
             Text(&quot;nope&quot;)
         } 
      } 
    }
  </code></pre>
  <p>And when I run it - I get the print out - but the text never changes - it always remains &quot;nope&quot;.  What am I doing wrong, and how do I do it right?   (Without using combine - I can do it with like a currentValueSubject and a .onreceive - but it's extra overhead, and I really want to know why the above code doesn't work - obviously I'm understanding something bad)</p>