Implemented isConnected for ios. It closes #1 for ios.

THis PR will conflict with  PR #39 . Need to be solved.