understanding ios design patterns