Граф коммитов

45 Коммитов

Автор SHA1 Сообщение Дата
Vincent Dondain e78a7a3291 [intro] Add availability messages checks to ApiTypoTest (#2240)
- ApiTypoTest now enforces the rules defined here: https://github.com/xamarin/xamarin-macios/wiki/BINDINGS#availability-attributes-messages.
- Update all availability messages to follow new ApiTypoTest rules.
- Fix `IsObsolete` to handle ObsoletedAttribute.
- Don't apply rule 1 on Obsolete attribute.
- Allow to skip rule 4.
- Prevent use of OSX, OS X.
2017-06-26 18:17:06 -04:00
Alex Soto bfaf62623e [Test][Intro] Fix introspection test on API changes for Xcode 9 Beta 1 (#2191)
* [Test][Intro] Fix introspection test on API changes for Xcode 9 Beta 1

* [introspection] Fix feedback from PR and bot tests

Removed XAMCORE_4_0 checks from our api definition, and added
a file with stubs for all of them instead. Cleaner binding file
and easier to remove in the future

Fixed introspection also for mac by moving some check into base test definition

* [CoreImage] Add CoreImage stubs so introspection test are happy

These need to be manually reviewed by whoever takes CoreImage framework
tracked in bugzilla so we do not forget

* Do the same API cleanup as in NSUnit

* [test][introspection] Enable MtouchNoSymbolStrip for device builds in order to avoid linking symbols meeded by test (#2196)

Rolf Kvinge [8:59 AM]
@dalexsoto the fix is to not strip the executable please PR that
(it should probably go into master as well). This probably started
happening when Jeff implemented support for stripping debug builds
(previously the setting was ignored)

* [foundation] Provide better messages

* [CoreImage] Fix Availability of CIEdgePreserveUpsampleFilter
2017-06-10 00:07:11 -07:00
Alex Soto e3f81f3c9d [UIKit] Update to Xcode8.3 beta 4 (#1855) 2017-03-28 10:12:17 -05:00
Sebastien Pouliot 97db1edcab [tvos][uikit] Fix two UITableViewDataSource that are not prohibited anymore (#1668)
Spotted by xtro

!missing-protocol-member! UITableViewDataSource::sectionIndexTitlesForTableView: not found
!missing-protocol-member! UITableViewDataSource::tableView:sectionForSectionIndexTitle:atIndex: not found

and it was in the header diff too

--- (nullable NSArray<NSString *> *)sectionIndexTitlesForTableView:(UITableView *)tableView __TVOS_PROHIBITED;                                                    // return list of section titles to display in section index view (e.g. "ABCD...Z#")
--- (NSInteger)tableView:(UITableView *)tableView sectionForSectionIndexTitle:(NSString *)title atIndex:(NSInteger)index __TVOS_PROHIBITED;  // tell table which section corresponds to section title/index (e.g. "B",1))
-+- (nullable NSArray<NSString *> *)sectionIndexTitlesForTableView:(UITableView *)tableView;                               // return list of section titles to display in section index view (e.g. "ABCD...Z#")
-+- (NSInteger)tableView:(UITableView *)tableView sectionForSectionIndexTitle:(NSString *)title atIndex:(NSInteger)index;  // tell table which section corresponds to section title/index (e.g. "B",1))
2017-03-28 09:29:17 -05:00
Alex Soto ce0d121062 [UIKit] Update for iOS 10.3 beta 1 (#1629) 2017-03-28 09:21:57 -05:00
Alex Soto 7bc52a12bd [test][introspection] Remove check for void return type on AsyncCandidates test (#1909)
We do support the use of [Async] on methods that do not return void,
we generate an overload with am out parameter to retrieve the returned value

```csharp
[CompilerGenerated]
public unsafe virtual Task BarStringAsync (int arg1)
{
	var tcs = new TaskCompletionSource<bool> ();
	var result = BarString(arg1, (obj_) => {
		if (obj_ != null)
			tcs.SetException (new NSErrorException(obj_));
		else
			tcs.SetResult (true);
	});
	return tcs.Task;
}

[CompilerGenerated]
public unsafe virtual Task BarStringAsync (int arg1, out string result)
{
	var tcs = new TaskCompletionSource<bool> ();
	result = BarString(arg1, (obj_) => {
		if (obj_ != null)
			tcs.SetException (new NSErrorException(obj_));
		else
			tcs.SetResult (true);
	});
	return tcs.Task;
}
```

Modified the introspection test to repor this, updated documentation
and update API definitions reported by introspection.
2017-03-24 11:02:07 -06:00
Vincent Dondain cda9212e9c [uikit] Update all Obsoleted and Deprecated messages (#1894)
* [uikit] Update all Obsoleted and Deprecated messages

Here are the 3 rules of thumb that have been applied:

- Never put OS version information in the message.
- Always put methods and properties between ' '.
- Use proper sentences and punctuation.

This will all be summarized in our wiki.
2017-03-22 14:47:05 -04:00
Sebastien Pouliot 7f6f2bf81d [uikit] Fix contest between UITextField.Ended[WithReason] events. Fixes #53174 (#1875)
iOS 10 added a new `textFieldDidEndEditing:reason:` to `UITextField`. It
gets called, if set, before the older `textFieldDidEndEditing`.

This cause a problem for code that does add events for both since the
internal `*Delegate` does override both (to allow events) so the call
might be "lost" without additional logic.

This fix makes sure that even using one (or the two) events will work
across all versions of iOS.

reference:
https://bugzilla.xamarin.com/show_bug.cgi?id=53174
2017-03-15 07:44:01 -05:00
Alex Soto 78052430ab [generator] Fixes bug 52570 - [generator] warn when [Static] is used in a [Category] (#1862)
https://bugzilla.xamarin.com/show_bug.cgi?id=52570

In some cases you will find **static** members inside categories like in the following example:

```objc
@interface FooObject (MyFooObjectExtension)
+ (BOOL)boolMethod:(NSRange *)range;
@end
```

This will lead to an **incorrect** Category C# interface definition:

```csharp
[Category]
[BaseType (typeof (FooObject))]
interface FooObject_Extensions {

	// Incorrect Interface definition
	[Static]
	[Export ("boolMethod:")]
	bool BoolMethod (NSRange range);
}
```

This is incorrect because in order to use the `BoolMethod` extension you need an instance of `FooObject` but you are binding an ObjC **static** extension, this is a side effect due to the fact of how C# extension methods are implemented.

The only way to use the above definitions is by the following ugly code:

```csharp
(null as FooObject).BoolMethod (range);
```

The recommendation to avoid this is to inline the `BoolMethod` definition inside the `FooObject` interface definition itself, this will allow you to call this extension like it is intended `FooObject.BoolMethod (range)`.

```csharp
[BaseType (typeof (NSObject))]
interface FooObject {

	[Static]
	[Export ("boolMethod:")]
	bool BoolMethod (NSRange range);
}
```

We will issue a warning (BI1117) whenever we find a `[Static]` member inside a `[Category]` definition. If you really want to have `[Static]` members inside your `[Category]` definitions you can silence the warning by using `[Category (allowStaticMembers: true)]` or by decorating either your member or `[Category]` interface definition with `[Internal]`.
2017-03-14 13:03:13 -06:00
Sebastien Pouliot bbde20c697 [uikit] Mark NSFileProviderExtension as [ThreadSafe]. Fixes #53075 (#1836)
Even if it's in UIKit, this is not a UI type and does not _suffer_ from
the UI thread restriction. In fact it's used with file coordination which
implies threading is required.

reference:
https://bugzilla.xamarin.com/show_bug.cgi?id=53075
2017-03-07 19:56:55 +01:00
Sebastien Pouliot 829a71dbbc Add some missing *Async version for existing API (#1527)
Taken out of our Xcode8 post-mortem: it's easy to forget (while adding)
or miss (while auditing) a `[Async]` attribute on the API that would
benefit from them.

API that are decorated with either:
* [Obsolete] (managed); or
* [Obsoleted] or [Deprecated] (native)
are not to be added *Async methods (or at least be reported as missing)

This also includes updated introspection tests that found the missing *Async API., ensuring that future API addition will immediately notice is an `[Async]` sounds useful.
2017-03-07 13:55:37 -05:00
Sebastien Pouliot d2cbd993ad Merge pull request #852 from spouliot/intro-model
[test][intro] Check for API parameters that are [Model] and not the [Protocol] interface
2017-01-12 17:11:40 -05:00
Sebastien Pouliot e238dac296 [ios][uikit] Fix [Model] in public API w/workarounds 2017-01-12 14:35:11 -05:00
Sebastien Pouliot aafa135c9c [uikit] Add convenience constructors for UISegmentedControl. Fixes #33163 (#1477)
* Existing `.ctor(object[])` now
    * changed to `params` (not a breaking change);
    * accept `NSString`, along with `string` and `UIImage`;
* Added `.ctor (NSArray)` (exposing the generated code to ease subclassing)
* Added `.ctor (params NSString[])`
* Added `.ctor (params string[])`
* Added `.ctor (params UIImage[])`

Also adds unit tests for all of them.

https://bugzilla.xamarin.com/show_bug.cgi?id=33163
2017-01-11 21:17:51 -05:00
Sebastien Pouliot b5632f9c2f merge xcode8.2 into master 2016-12-12 21:26:23 -05:00
Sebastien Pouliot 16c2200804 [tests][intro] Add checks for [Field] that should have [Notification] attributes (#1289)
Also:

* some refactoring to reduce the reflection usage for each field-based
  introspection tests;

* some fixes for existing bindings, mostly missing [Notification]

* removal of `unsafe` in the notification binding generation (not needed)

* Ignore the new test on XM until the API have been fixed
2016-12-02 12:05:05 -05:00
Sebastien Pouliot 96f0c09225 [uikit] Add UIFontTextStyle enum to ease UIFont[Descriptor].GetPreferred* API usage. Fixes #42967 (#863)
New enum UIFontTextStyle maps to UIFontTextStyle* fields. Allows easier use of
* UIFont.GetPreferredFontForTextStyle
* UIFontDescriptor.GetPreferredDescriptorForTextStyle

https://bugzilla.xamarin.com/show_bug.cgi?id=42967
2016-09-21 07:35:36 +02:00
Sebastien Pouliot 347ed1a56a [uikit] Add missing [NullAllowed] on UIImageView ctors. Fixes #42929 (#864)
The UIImage arguments of both .ctor (single and double) can be null.

https://bugzilla.xamarin.com/show_bug.cgi?id=42929
2016-09-21 07:31:27 +02:00
Chris Hamons c80d72c7d6 Remove unnecessary public from binding definition files
- Was causing conflicts between {App,UI}Kit and CloudKit
2016-09-16 14:47:08 -05:00
Alex Soto 5149d3f9af [UIKit] re-enable the iOS 10 API that were waiting on bug 43579 fix 2016-09-14 14:57:03 -05:00
Alex Soto 8aa61bd1d9 [UIKit] Update to Xcode8-GM (#802) 2016-09-07 20:25:28 -05:00
Sebastien Pouliot 4b90fce057 [tvos] Add missing attributes to get introspection to works on tvOS 9.0, 9.1, 9.2 and 10.0 (#798) 2016-09-07 15:18:20 -04:00
Alex Soto 424fe9ae1e [UIKit] Remove 3 protocol members until bug 43579 is fixed (#783)
https://bugzilla.xamarin.com/show_bug.cgi?id=43579

We are removing the following 3 protocol members
- UITextFieldDelegate.EditingEnded2 (UITextField textField, UITextFieldDidEndEditingReason reason)
- UITextViewDelegate.ShouldInteractWithUrl2 (UITextView textView, NSUrl url, NSRange characterRange, UITextItemInteraction interaction)
- UITextViewDelegate.ShouldInteractWithTextAttachment2 (UITextView textView, NSTextAttachment textAttachment, NSRange characterRange, UITextItemInteraction interaction)

Reasons:
- We need to fix bug https://bugzilla.xamarin.com/show_bug.cgi?id=43579
- Bad naming, we do not want 2 suffix

Hopefully we can have this ready for C8SR0 or C8SR1
2016-09-07 10:08:43 -04:00
Sebastien Pouliot 60e650ae6d [tests][intro] Fix availability attributes to match reality (not headers) down to iOS 8.4 2016-08-31 17:34:02 -04:00
Sebastien Pouliot f63ecd7a21 [uikit] Re-expose 'defaultFormat' in UIGraphicsRendererFormat subclasses since it returns a 'instancetype'. Fixes #43640 (#643)
https://bugzilla.xamarin.com/show_bug.cgi?id=43640
2016-08-23 10:53:57 -04:00
Alex Soto 16d5d68503 [UIKit] Updated UIKit to xcode8-beta6 (#636)
Expected extrospection test failures:

- ios.unclassified:!missing-field! UIApplicationInvalidInterfaceOrientationException not bound

Generator bugs:

- HACK: We have a generator bug(?) that won't allow overloads (AmbiguousMatchException) in protocols

tvOS/iOS 9 Introspection Expected failures (UIKit Only):

- [FAIL] UIKit.UIContentSizeCategoryExtensions.UIContentSizeCategoryUnspecified
Generated enum extensions do not honor availability on NSString properties

API Diff, expected changes (verified and correct):

Type Changed: UIKit.UIContentSizeCategory

Modified fields:

	ExtraExtraExtraLarge = 6 7
	ExtraExtraLarge = 5 6
	ExtraLarge = 4 5
	ExtraSmall = 0 1
	Large = 3 4
	Medium = 2 3
	Small = 1 2

Added values:

	AccessibilityExtraExtraExtraLarge = 12,
	AccessibilityExtraExtraLarge = 11,
	AccessibilityExtraLarge = 10,
	AccessibilityLarge = 9,
	AccessibilityMedium = 8,
	Unspecified = 0,
2016-08-22 08:44:43 -04:00
Sebastien Pouliot 75031a3504 [uikit] Some adjustments for watchOS and tvOS (#593)
watchOS:
!unknown-field! UIAccessibilityAssistiveTouchStatusDidChangeNotification bound
!unknown-field! UIAccessibilityHearingDevicePairedEarDidChangeNotification bound
!unknown-native-enum! UIAccessibilityCustomRotorDirection bound
!unknown-native-enum! UIAccessibilityHearingDeviceEar bound
!unknown-native-enum! UIDisplayGamut bound
!unknown-native-enum! UITextItemInteraction bound
!unknown-native-enum! UITimingCurveType bound
!unknown-native-enum! UITraitEnvironmentLayoutDirection bound
!unknown-native-enum! UIViewAnimatingPosition bound
!unknown-native-enum! UIViewAnimatingState bound

tvOS:
!unknown-field! UIAccessibilityHearingDevicePairedEarDidChangeNotification bound
!unknown-native-enum! UIAccessibilityHearingDeviceEar bound
!unknown-pinvoke! UIAccessibilityHearingDevicePairedEar bound
2016-08-10 12:01:38 -04:00
Sebastien Pouliot 21891ea3bc [spritekit] Replace incorrect TV (it's TVOS) condition to fix SKNode (#569)
references:
!missing-protocol-conformance! SKNode should conform to UIFocusItem
!wrong-base-type! SKNode expected UIResponder actual NSObject
2016-08-08 11:51:25 -04:00
Alex Soto 9728897c86 WIP [iOS10, UIKit] More work (#566) 2016-08-06 11:06:39 -04:00
Vincent Dondain 7446afb5b7 [uikit] NSLayoutContraint fixes (#435)
- Fix missing [Internal] attribute.
- Fix styling.
2016-07-19 18:33:16 -04:00
Sebastien Pouliot d6e00781eb [tests] Fix introspection tests running on an iOS 9.3 device (#380) 2016-07-12 09:46:41 -04:00
Sebastien Pouliot afb3ea1e3f Bump Xcode version to beta 2 (#349)
Fix issues with monotouch-tests with beta2

* TLSMaximumSupportedProtocol returns Unknown, which also means default,
  instead of SslProtocol.Tls_1_2

* Setting NSZone.Name crash the app

* The MDLMesh tests are broken in a different way than beta1

* [callkit] Disable CTCallCenter default ctor as it breaks introspection

> [FAIL] Default constructor not allowed for CoreTelephony.CTCallCenter : SIGILL

The exception, that we catch, puts the process in an unstable state.

This cause weird results and crash later (wrong dispatch queue on main
thread) when testing MapKit.

Crashed Thread:        0  tid_a07  Dispatch queue: CTCallCenter

Exception Type:        EXC_BAD_ACCESS (SIGABRT)
Exception Codes:       KERN_INVALID_ADDRESS at 0x0000000000000004
Exception Note:        EXC_CORPSE_NOTIFY

VM Regions Near 0x4:
-->
    __TEXT                 0000000000097000-00000000004d2000 [ 4332K] r-x/rwx SM=COW  /Users/USER/Library/Developer/CoreSimulator/Devices/9446B344-62A2-42A8-A8EE-9FE7AC6BA5C8/data/Containers/Bundle/Application/81183608-DADF-4226-B7FE-4B43759D679A/introspection.app/introspection

Application Specific Information:
BUG IN CLIENT OF LIBDISPATCH: dispatch_barrier_sync called on queue already owned by current thread
abort() called
CoreSimulator 278 - Device: iPhone 5 - Runtime: iOS 10.0 (14A5297c) - DeviceType: iPhone 5

Some beta2 adjustments (removals) to get green tests and be able to merge it so bindings of beta2 can start

* [tests] NEFlowMetaData conformance to NSSecureCoding and NSCopying is new in beta2 (and check fails on OSX 10.11)

* [uikit] Add [UIScrollView|UITableViewController].refreshControl to fix monotouch-test build

UIRefreshControlHosting was removed in beta2 but we still need the
refreshControl property on UIScrollView and UITableViewController
to build monotouch-test
2016-07-07 13:10:24 -04:00
Sebastien Pouliot dde6a06fcd [uikit] Fix new UICollectionViewDataSourcePrefetching and UIContentSizeCategoryAdjusting protocols (#277)
The two later failure reports (references) were not prefixed with [FAIL]
so they were filtered out by in the bot results.

references:
	[FAIL] iOSApiProtocolTest.ApiProtocolTest.GeneralCase : 2 types do not really conform to the protocol interfaces
[FAIL] Could not load UIKit.UICollectionViewDataSourcePrefetching
[FAIL] Could not load UIKit.UIContentSizeCategoryAdjusting
2016-06-25 12:43:36 -04:00
Miguel de Icaza 35e17d7d97 Merge pull request #237 from migueldeicaza/xcode8-uikit
Xcode8 uikit
2016-06-24 21:54:28 -04:00
Miguel de Icaza b15bce8a8f [ios10,uikit] Address various issues identified by Sebastien 2016-06-21 23:23:52 -04:00
Sebastien Pouliot 45cfe49763 [uikit] Fix UIGraphicsPdfRenderer* type names (#251)
The native name use `PDF` but this was not provided to the generator.

This also explains why `init` returned `nil` - it was not the common
unavailability of the selector, but the incorrect type name used.

references:
!unknown-type! UIGraphicsPdfRenderer bound
!unknown-type! UIGraphicsPdfRendererContext bound
!unknown-type! UIGraphicsPdfRendererFormat bound
2016-06-21 17:14:54 -04:00
Miguel de Icaza 06c59838c1 [ios10,uikit] More API updates 2016-06-19 21:53:43 -04:00
Sebastien Pouliot 7c688482e8 [uikit] Remove [BaseType] from type are that only [Protocol] (#231)
and not a [Model] as it's not required and also cause failures,
which we need to investigate (and report an error or fix).

* UIRefreshControlHosting
* UITableViewDataSourcePrefetching

reference:
[FAIL] iOSApiProtocolTest.ApiProtocolTest.GeneralCase : 2 types do not really conform to the protocol interfaces
2016-06-18 06:42:12 -07:00
Miguel de Icaza 10e744e4de Merge pull request #204 from migueldeicaza/xcode8-uikit
[Review][iOS10,UIKit] Small API introductions.
2016-06-17 11:21:38 -07:00
Miguel de Icaza ad7f24e969 [iOS10,UIKit] Small API introductions.
Of note: NSLayoutConstraints.cs provides the generic methods, as the
generator currently does not know how to either annotate generic
return types (necesary to build), nor does it have "where" support.

UITraitCollection - re-indented to follow the tab convention.
2016-06-17 10:46:57 -04:00
Sebastien Pouliot a633b79684 [uikit] Fix issues found with introspection tests (#221)
Some types can't call `init` and return valid instances, some returns
nil and gives an invalid handle and one fails (throws) [1]

references:
[FAIL] UIKit.UIGraphicsPdfRenderer : Handle
[FAIL] UIKit.UIGraphicsPdfRendererContext : Handle
[FAIL] UIKit.UIGraphicsPdfRendererFormat : Handle
[FAIL] Default constructor not allowed for UIKit.UIPresentationController : Objective-C exception thrown. Name: NSInvalidArgumentException Reason: Don't call -[UIPresentationController init].
2016-06-17 07:10:43 -07:00
Miguel de Icaza ae3532f38c [uikit] Implement feedback from review 2016-06-14 23:35:05 -07:00
Miguel de Icaza 50458be3af [ios10,UIKit] UIGraphicsRenderer 2016-06-14 15:53:41 -07:00
Manuel de la Pena 173f7e4891 [Fix] Fix bug 24078 by adding the required attrs to generate the events. 2016-05-14 12:47:46 +02:00
Rolf Bjarne Kvinge 5830166c63 Build the platform assemblies. 2016-04-24 14:47:26 -04:00