Useful code for ios projects