Skip to content

Commit

Permalink
make static, add intro ignore
Browse files Browse the repository at this point in the history
  • Loading branch information
tj_devel709 committed Oct 17, 2023
1 parent 2de0968 commit c91f292
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/PassKit/PKPayLaterView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ static void TrampolineValidateAmount (IntPtr block, byte eligible)
[UnsupportedOSPlatform ("tvos")]
#endif
[BindingImpl (BindingImplOptions.Optimizable)]
public void ValidateAmount (NSDecimalNumber amount, string currencyCode, Action<bool> callback)
public static void ValidateAmount (NSDecimalNumber amount, string currencyCode, Action<bool> callback)
{
if (callback is null)
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (callback));
Expand Down
2 changes: 1 addition & 1 deletion src/passkit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2759,7 +2759,7 @@ interface PKDeferredPaymentRequest {
[BaseType (typeof (UIView))]
[DisableDefaultCtor]
interface PKPayLaterView {
// [DesignatedInitializer]

[Export ("initWithAmount:currencyCode:")]
NativeHandle Constructor (NSDecimalNumber amount, string currencyCode);

Expand Down
5 changes: 5 additions & 0 deletions tests/introspection/ApiCtorInitTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,11 @@ protected virtual bool Match (ConstructorInfo ctor, Type type)
if (cstr == "Void .ctor(System.String, Foundation.NSBundle)")
return true;
break;
case "PKPayLaterView":
// headers have: (instancetype)initWithFrame:(CGRect)frame NS_UNAVAILABLE;
if (cstr == "Void .ctor(CoreGraphics.CGRect)")
return true;
break;
case "VNDetectedPoint":
// This class is not meant to be instantiated
if (cstr == "Void .ctor(Double, Double)")
Expand Down
5 changes: 1 addition & 4 deletions tests/monotouch-test/PassKit/PKPayLaterViewTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,11 @@ public void ValidateAmountTest ()
{
TestRuntime.AssertXcodeVersion (15, 0);

var payLaterView = new PKPayLaterView (new NSDecimalNumber (100), "USD");

// From testing with Xcode 15.0.0, all values give the value of false to the completion handler.
// Perhaps this will change in the future.
// Also appears to be a static method in Xcode 15.0.0 but not in the headers or docs.
// Apple feedback was submitted here: https://feedbackassistant.apple.com/feedback/13268898
for (int i = 0; i < 1000; i++){
payLaterView.ValidateAmount (new NSDecimalNumber (i), "USD", (eligible) => {
PKPayLaterView.ValidateAmount (new NSDecimalNumber (i), "USD", (eligible) => {
Assert.False (eligible);
});
}
Expand Down

0 comments on commit c91f292

Please sign in to comment.