Skip to content

Commit 5b9cdd7

Browse files
authored
Merge pull request #10 from Softeq/feature/allow-null-args
Extend public API
2 parents 52bee79 + a1b2ab6 commit 5b9cdd7

File tree

4 files changed

+33
-10
lines changed

4 files changed

+33
-10
lines changed

azure-pipelines/templates/vars.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
variables:
2-
MACOS_VM_IMAGE: 'macos-12'
2+
MACOS_VM_IMAGE: 'macos-13'

samples/ViewController.cs

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,21 @@ private void MakeBasic()
2929

3030
private void MakeWithDurationAndPosition()
3131
{
32-
View!.MakeToast(new NSString("This is a piece of toast on top for 3 seconds"),
33-
3.0f,
34-
CSToastPosition.Center);
32+
var position = CSToastPosition.Center;
33+
// or custom coordinates:
34+
// var position = NSValue.FromCGPoint(new CGPoint(30, 200));
35+
36+
View!.MakeToast(
37+
message: new NSString("This is a piece of toast on top for 3 seconds"),
38+
duration: 3.0f,
39+
position: position,
40+
title: new NSString("Test Title"),
41+
image: null,
42+
style: null,
43+
completion: (didTap) =>
44+
{
45+
Debug.WriteLine(didTap ? "Did Tap" : "No Tap");
46+
});
3547
}
3648

3749
private void MakeWithTitle()

src/ApiDefinition.cs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,24 @@ interface Toast
2121
void MakeToast(NSString message, nfloat duration, NSString position);
2222

2323
[Export("makeToast:duration:position:title:image:style:completion:")]
24-
void MakeToast(NSString message, nfloat duration, NSString position, NSString title, UIImage image, CSToastStyle style, CompletionDelegate completion);
24+
void MakeToast(
25+
NSString message,
26+
nfloat duration,
27+
NSObject position,
28+
[NullAllowed] NSString title,
29+
[NullAllowed] UIImage image,
30+
[NullAllowed] CSToastStyle style,
31+
[NullAllowed] CompletionDelegate completion);
2532

2633
[Export("showToast:")]
2734
void ShowToast(UIView view);
2835

2936
[Export("showToast:duration:position:completion:")]
30-
void ShowToast(UIView view, double duration, NSString position, CompletionDelegate completion);
37+
void ShowToast(
38+
UIView view,
39+
double duration,
40+
NSString position,
41+
[NullAllowed] CompletionDelegate completion);
3142

3243
[Export("hideToast:")]
3344
void HideToast(UIView view);

src/ToastBindings.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@
88
<Title>Toast for Xamarin.iOS</Title>
99
<Description>Xamarin iOS binding library of Toast - toast notifications to the UIView.</Description>
1010
<Company>Softeq Development Corporation</Company>
11-
<Copyright>Copyright © 2018 Softeq Development Corporation</Copyright>
12-
<Version>4.0.0.2</Version>
11+
<Copyright>Copyright © 2024 Softeq Development Corporation</Copyright>
12+
<Version>4.0.0.3</Version>
1313
<Authors>Softeq Development Corp.</Authors>
1414
<Owners>Softeq Development Corp.</Owners>
1515
<PackageProjectUrl>https://github.com/Softeq/Toast-xamarin-ios</PackageProjectUrl>
1616
<PackageLicenseFile>LICENSE</PackageLicenseFile>
17-
<PackageTags>toast;ios;xamarin;binding;softeq;library;uikit;ui</PackageTags>
17+
<PackageTags>toast;ios;xamarin;binding;softeq;library;uikit;ui;maui;dotnet;mobile</PackageTags>
1818
<PackageReadmeFile>README.md</PackageReadmeFile>
19-
<PackageReleaseNotes>Migration to .NET6</PackageReleaseNotes>
19+
<PackageReleaseNotes></PackageReleaseNotes>
2020
</PropertyGroup>
2121

2222
<ItemGroup>

0 commit comments

Comments
 (0)