Set delegate when running iOS 5.1 or later

The delegate is needed to avoid conflict with UIScrollView