iOS 6 support & adding explicit long cast

It was crashing under iOS 6 because of the use edgesForExtendedLayout &UIRectEdgeTop