title: Cannot convert value of type 'Int' to expected argument type 'UnsafeMutablePointer<Int32>!'
body: <p>From using this <a href="https://stackoverflow.com/a/26012201/6165231">Answer</a> I'm getting this error in swift 4.1, i.e <code>Cannot convert value of type 'Int' to expected argument type 'UnsafeMutablePointer&lt;Int32&gt;!'</code></p>
  
  <pre><code>var notify_token: Int
  notify_register_dispatch("com.apple.springboard.lockstate", notify_token, DispatchQueue.main, { (_ token: Int) -&gt; Void in 
      var state: UInt64 = UINT64_MAX
      notify_get_state(token, state)
      if state == 0 {
          print("unlock device")
      }
      else {
          print("lock device")
      }
  </code></pre>
  
  <p>How to resolve this?</p>
  
  <p><a href="https://i.stack.imgur.com/iQvKG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/iQvKG.png" alt="enter image description here"></a></p>