title: How to get my IP address programmatically on iOS/macOS?
body: <p>I would like to obtain my iPad's IP address programmatically.
  How can I query the networking subsystem to find out what my IPv4 (and IPv6) addresses are?</p>
  
  <p>PS: Can I disable IPv6 somehow?</p>