Skip to content

Commit

Permalink
"[Intents] Update bindings for Xcode 13.0 betas 1 through 5"
Browse files Browse the repository at this point in the history
  • Loading branch information
rachelkang committed Sep 17, 2021
1 parent 3fc6b06 commit d1ce9ff
Show file tree
Hide file tree
Showing 11 changed files with 446 additions and 408 deletions.
67 changes: 67 additions & 0 deletions src/Intents/INPerson.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
using System;
using CoreGraphics;
using Foundation;
using ObjCRuntime;
using System.Runtime.Versioning;

#nullable enable

namespace Intents
{

#if !TVOS
public partial class INPerson
{

#if !NET
[Introduced (PlatformName.iOS, 15,0)]
[Introduced (PlatformName.MacOSX, 12,0)]
[Introduced (PlatformName.WatchOS, 8,0)]
#else
[SupportedOSPlatform ("ios15.0")]
[SupportedOSPlatform ("macos12.0")]
#endif //!NET
public enum INPersonType {
Me = 0,
ContactSuggestion = 1,
}

#if !NET
[Introduced (PlatformName.iOS, 15,0)]
[Introduced (PlatformName.MacOSX, 12,0)]
[Introduced (PlatformName.WatchOS, 8,0)]
#else
[SupportedOSPlatform ("ios15.0")]
[SupportedOSPlatform ("macos12.0")]
#endif //!NET
public INPerson (INPersonHandle personHandle, NSPersonNameComponents? nameComponents, string? displayName, INImage? image, string? contactIdentifier, string? customIdentifier, bool isMe, INPersonSuggestionType suggestionType) :
this (personHandle, nameComponents, displayName, image, contactIdentifier, customIdentifier, isMe, suggestionType, INPersonType.Me)
{
}

#if !NET
[Introduced (PlatformName.iOS, 15,0)]
[Introduced (PlatformName.MacOSX, 12,0)]
[Introduced (PlatformName.WatchOS, 8,0)]
#else
[SupportedOSPlatform ("ios15.0")]
[SupportedOSPlatform ("macos12.0")]
#endif //!NET
public INPerson (INPersonHandle personHandle, NSPersonNameComponents? nameComponents, string? displayName, INImage? image, string? contactIdentifier, string? customIdentifier, bool isMe, INPersonSuggestionType suggestionType, INPersonType personType) : base (NSObjectFlag.Empty)
{
switch (personType) {
case INPersonType.Me:
InitializeHandle (InitWithMe (personHandle, nameComponents, displayName, image, contactIdentifier, customIdentifier, isMe, suggestionType),
"initWithPersonHandle:nameComponents:displayName:image:contactIdentifier:customIdentifier:isMe:suggestionType:");
break;
case INPersonType.ContactSuggestion:
InitializeHandle (InitWithContactSuggestion (personHandle, nameComponents, displayName, image, contactIdentifier, customIdentifier, isMe, suggestionType),
"initWithPersonHandle:nameComponents:displayName:image:contactIdentifier:customIdentifier:isContactSuggestion:suggestionType:");
break;
default:
throw new ArgumentException (nameof (personType));
}
}
}
#endif // !TVOS
}
2 changes: 1 addition & 1 deletion src/foundation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5420,7 +5420,7 @@ partial interface NSUserActivity

// From NSUserActivity (IntentsAdditions)

[Watch (5,0), NoTV, NoMac, iOS (12,0)]
[Watch (5,0), NoTV, Mac (12,0), iOS (12,0)]
[NullAllowed, Export ("suggestedInvocationPhrase")]
string SuggestedInvocationPhrase {
// This _simply_ ensure that the Intents namespace (via the enum) will be present which,
Expand Down
1 change: 1 addition & 0 deletions src/frameworks.sources
Original file line number Diff line number Diff line change
Expand Up @@ -999,6 +999,7 @@ INTENTS_SOURCES = \
Intents/INMessageAttributeOptionsResolutionResult.cs \
Intents/INMessageAttributeResolutionResult.cs \
Intents/INPaymentStatusResolutionResult.cs \
Intents/INPerson.cs \
Intents/INPriceRange.cs \
Intents/INRadioTypeResolutionResult.cs \
Intents/INRelativeReferenceResolutionResult.cs \
Expand Down
Loading

0 comments on commit d1ce9ff

Please sign in to comment.