transferred iOS snippets from other repo