Finished basic implementation for ios. It closes #2