It also functions in iOS versions greater than 5.1, however you must include URL schemes in the URL types in Xcode:
![enter image description here](https://i.stack.imgur.com/w6dQW.png)
Then you can use
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"prefs:root=WIFI"]];
It's an open system WiFi setting now.