title: What is the usage of guard let self = self else { return }
body: <p>I just learned how to use the Result type recently from <a href="https://youtu.be/8aPjqLqUEKA?t=626" rel="nofollow noreferrer">Sean Allen's video</a>, and I get the idea of using it. However, while I was writing a code, there is a line I don't understand.</p>
  <p>The line is 87 in the picture (or this -&gt; <code>guard let self = self else { return }</code> )
  At first, I was just doing the same stuff as he did, but I wonder why he add the line in the code. I think he wrote it because the self can be nil and wanted to make sure if the self is not nil and return from the function if it gets nil.</p>
  <p>And my question is</p>
  <ol>
  <li>when or in which situation the self can be nil?
  and</li>
  <li>if self gets nil, I think it won't trigger the following line (the one for checking the result), so both of the updateUI function and presentGFAlert... function won't be triggered and nothing shows up on the screen, right?</li>
  </ol>
  <p><a href="https://i.stack.imgur.com/IOKrE.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IOKrE.jpg" alt="enter image description here" /></a></p>