title: how to test iOS device network is using IPv6 or IPv4?
body: <p>iOS 9 will use IPv6-only network. To support IPv6, my iOS app have to stop using AF_INET (and many other apis such as struct in_addr), and instead, use AF_INET6. </p>
  
  <p>But It should also support iOS 8 and earlier, so I have to continue to use AF_INET. The problem is how to know which network the system is using, IPv6 or IPv4? So I can use different apis according to different network condition.</p>