Fixed view resizing in iOS and code cleanup