diff --git a/azure-pipelines/templates/vars.yml b/azure-pipelines/templates/vars.yml index 15e011f..3db285f 100644 --- a/azure-pipelines/templates/vars.yml +++ b/azure-pipelines/templates/vars.yml @@ -1,2 +1,2 @@ variables: - MACOS_VM_IMAGE: 'macos-12' \ No newline at end of file + MACOS_VM_IMAGE: 'macos-13' \ No newline at end of file diff --git a/samples/ViewController.cs b/samples/ViewController.cs index 2bc0e80..758efa1 100644 --- a/samples/ViewController.cs +++ b/samples/ViewController.cs @@ -29,9 +29,21 @@ private void MakeBasic() private void MakeWithDurationAndPosition() { - View!.MakeToast(new NSString("This is a piece of toast on top for 3 seconds"), - 3.0f, - CSToastPosition.Center); + var position = CSToastPosition.Center; + // or custom coordinates: + // var position = NSValue.FromCGPoint(new CGPoint(30, 200)); + + View!.MakeToast( + message: new NSString("This is a piece of toast on top for 3 seconds"), + duration: 3.0f, + position: position, + title: new NSString("Test Title"), + image: null, + style: null, + completion: (didTap) => + { + Debug.WriteLine(didTap ? "Did Tap" : "No Tap"); + }); } private void MakeWithTitle() diff --git a/src/ApiDefinition.cs b/src/ApiDefinition.cs index 17cdd83..88ddea5 100644 --- a/src/ApiDefinition.cs +++ b/src/ApiDefinition.cs @@ -21,13 +21,24 @@ interface Toast void MakeToast(NSString message, nfloat duration, NSString position); [Export("makeToast:duration:position:title:image:style:completion:")] - void MakeToast(NSString message, nfloat duration, NSString position, NSString title, UIImage image, CSToastStyle style, CompletionDelegate completion); + void MakeToast( + NSString message, + nfloat duration, + NSObject position, + [NullAllowed] NSString title, + [NullAllowed] UIImage image, + [NullAllowed] CSToastStyle style, + [NullAllowed] CompletionDelegate completion); [Export("showToast:")] void ShowToast(UIView view); [Export("showToast:duration:position:completion:")] - void ShowToast(UIView view, double duration, NSString position, CompletionDelegate completion); + void ShowToast( + UIView view, + double duration, + NSString position, + [NullAllowed] CompletionDelegate completion); [Export("hideToast:")] void HideToast(UIView view); diff --git a/src/ToastBindings.csproj b/src/ToastBindings.csproj index e0deab5..e10e6bf 100644 --- a/src/ToastBindings.csproj +++ b/src/ToastBindings.csproj @@ -8,15 +8,15 @@