The problems of Wi-Fi Apple's been dragging a while and it seems that some people are still experiencing problems, even with iOS 8.1.2.
Unfortunately, for this problem there is a solution that guarantees 100% of the problems with connections to Wi-Fi. One possible solution may be to restore the network settings of the device. For this we simply have to access:
Settings> General> Reset> Reset Network Settings.
Once followed these steps, the device requested confirmation and then restart once it has been turned will be necessary to find and configure Wi-Fi networks to which we connect because, to restore these settings, these will be deleted the device.
If that does not work, you should take a look at the possible solutions to WiFi connections on iPhone with iOS 8. It is also recommended to restart the router, remember that sometimes this may be the problem.