iOS: pinch gesture detector and some cleanup