[uikit] Duplicate bindings for 'UIScrollView.ContentOffset' to get correct availability information. Fixes #4893 (#5007)

`ContentOffset` was moved to `UIFocusItemScrollableContainer` in iOS 12.
Since it's a new protocol it's decorated as introduced in iOS 12 - but
the API was actually already available for a long time.

The _trick_ is to keep the original binding inside `UIScrollView`
so it overrides the protocol and keeps the correct availability info.
It requires adding `new` to bindings to avoid compiler warnings.

reference: https://github.com/xamarin/xamarin-macios/issues/4893

---

from @rolfbjarne 

In iOS 12 this property was moved to a protocol, but that protocol's
availability attributes limits it to iOS 12, not iOS 2 where this property was
originally introduced.

This is problematic, because it means we'll throw a
PlatformNotSupportedException if someone tries to call it on 32-bit iOS.

So put the property back on UIScrollView, so that the generated code ends up
with the right availability attributes (and a correct 32-bit implementation).

https://github.com/xamarin/xamarin-macios/pull/5004
This commit is contained in:
monojenkins 2018-10-18 14:37:30 -04:00 коммит произвёл Sebastien Pouliot
Родитель 99641c7fcd
Коммит 1ec90f0fe5
1 изменённых файлов: 4 добавлений и 0 удалений

Просмотреть файл

@ -9718,6 +9718,10 @@ namespace UIKit {
[Export ("initWithFrame:")]
IntPtr Constructor (CGRect frame);
// moved to UIFocusItemScrollableContainer in iOS 12 - but that makes the availability information incorrect (so `new` is used to avoid compiler warnings)
[Export ("contentOffset")]
new CGPoint ContentOffset { get; set; }
[Export ("contentSize")]
new CGSize ContentSize { get; set; }