Make it compile with Xamarin.iOS 6.3+. Fixes #11592.

This looks quite ugly, but I do not know a better way.