I found this sample code to get all local IP addresses, but I don\'t find an easy solution to get the public IP.
A legacy class from Apple allowed to do that ... bu
I use ipify and with no complaints.
NSURL *url = [NSURL URLWithString:@"https://api.ipify.org/"]; NSString *ipAddress = [NSString stringWithContentsOfURL:url encoding:NSUTF8StringEncoding error:nil]; NSLog(@"My public IP address is: %@", ipAddress);