title: Unsafepointer adjustment for Swift 4
body: <p>I have not found a solution how i can adjust the following lines (error) to Swift 4. Regarding to documents, withUnsafePointer method should be used but i could not find a way to add addressBytes.bytes into code.</p>
  
  <p><a href="https://i.stack.imgur.com/C8BDt.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/C8BDt.png" alt="enter image description here"></a></p>
  
  <pre><code>func netServiceDidResolveAddress(_ sender: NetService) {
      //service.addresses - array containing NSData objects, each of which contains an appropriate
      //sockaddr structure that you can use to connect to the socket
      for addressBytes in sender.addresses!
      {
          var inetAddress : sockaddr_in!
          var inetAddress6 : sockaddr_in6?
          //NSData’s bytes returns a read-only pointer (const void *) to the receiver’s contents.
          //var bytes: UnsafePointer&lt;()&gt; { get }
          let inetAddressPointer = UnsafePointer&lt;sockaddr_in&gt;(addressBytes.bytes)
          //Access the underlying raw memory
          inetAddress = inetAddressPointer.memory
  
          if inetAddress.sin_family == __uint8_t(AF_INET) //Note: explicit convertion (var AF_INET: Int32 { get } /* internetwork: UDP, TCP, etc. */)
          {
          }
          else
          {
              if inetAddress.sin_family == __uint8_t(AF_INET6) //var AF_INET6: Int32 { get } /* IPv6 */
              {
                  let inetAddressPointer6 = UnsafePointer&lt;sockaddr_in6&gt;(addressBytes.bytes)
                  inetAddress6 = inetAddressPointer6.memory
                  inetAddress = nil
              }
              else
              {
                  inetAddress = nil
              }
          }
          var ipString : UnsafePointer&lt;Int8&gt;?
          //static func alloc(num: Int) -&gt; UnsafeMutablePointer&lt;T&gt;
          let ipStringBuffer = UnsafeMutablePointer&lt;Int8&gt;.allocate(capacity: Int(INET6_ADDRSTRLEN))
              if (inetAddress != nil)
          {
  </code></pre>