Skip to content

Commit

Permalink
[Intents] Add a generic version for INInteraction.GetParameterValue
Browse files Browse the repository at this point in the history
  • Loading branch information
dalexsoto committed Aug 15, 2017
1 parent c5ef2f4 commit 30378aa
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 2 deletions.
24 changes: 24 additions & 0 deletions src/Intents/INInteraction.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
//
// INInteraction.cs
//
// Authors:
// Alex Soto <[email protected]>
//
// Copyright 2017 Xamarin Inc. All rights reserved.
//

#if XAMCORE_2_0
using System;
using XamCore.Foundation;
using XamCore.ObjCRuntime;

namespace XamCore.Intents {
public partial class INInteraction {

public T GetParameterValue<T> (INParameter parameter) where T : NSObject
{
return Runtime.GetNSObject<T> (_GetParameterValue (parameter));
}
}
}
#endif
1 change: 1 addition & 0 deletions src/frameworks.sources
Original file line number Diff line number Diff line change
Expand Up @@ -858,6 +858,7 @@ INTENTS_SOURCES = \
Intents/INGetCarLockStatusIntentResponse.cs \
Intents/INGetCarPowerLevelStatusIntentResponse.cs \
Intents/INIntentResolutionResult.cs \
Intents/INInteraction.cs \
Intents/INMessageAttributeOptionsResolutionResult.cs \
Intents/INMessageAttributeResolutionResult.cs \
Intents/INPaymentStatusResolutionResult.cs \
Expand Down
4 changes: 2 additions & 2 deletions src/intents.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2809,10 +2809,10 @@ interface INInteraction : NSSecureCoding, NSCopying {

// From INParameter.h INInteraction ()

[Internal]
[iOS (11,0), Watch (4,0), NoMac]
[Export ("parameterValueForParameter:")]
[return: NullAllowed]
NSObject GetParameterValue (INParameter parameter);
IntPtr _GetParameterValue (INParameter parameter);
}

[Introduced (PlatformName.iOS, 10, 0)]
Expand Down

0 comments on commit 30378aa

Please sign in to comment.