Skip to content

Commit

Permalink
[uikit] Duplicate bindings for 'UIScrollView.ContentOffset' to get co…
Browse files Browse the repository at this point in the history
…rrect availability information. Fixes xamarin#4893

`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: xamarin#4893
  • Loading branch information
Sebastien Pouliot committed Oct 12, 2018
1 parent 31ed342 commit 13d58be
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/uikit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10040,6 +10040,10 @@ interface UIScrollView : UIFocusItemScrollableContainer {
[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; }

Expand Down

0 comments on commit 13d58be

Please sign in to comment.