Samples of code for ios7