diff --git a/src/corelocationui.cs b/src/corelocationui.cs new file mode 100644 index 000000000000..0638818d6080 --- /dev/null +++ b/src/corelocationui.cs @@ -0,0 +1,49 @@ +using CoreGraphics; +using ObjCRuntime; +using Foundation; +using UIKit; + +using System; + +namespace CoreLocationUI { + + [NoTV, NoMac, NoWatch, iOS (15,0), MacCatalyst (15,0)] + [Native] + public enum CLLocationButtonIcon : long { + None = 0, + ArrowFilled, + ArrowOutline, + } + + [NoTV, NoMac, NoWatch, iOS (15,0), MacCatalyst (15,0)] + [Native] + public enum CLLocationButtonLabel : long { + None = 0, + CurrentLocation, + SendCurrentLocation, + SendMyCurrentLocation, + ShareCurrentLocation, + ShareMyCurrentLocation, + } + + [NoTV, NoMac, NoWatch, iOS (15,0), MacCatalyst (15,0)] + [BaseType (typeof (UIControl))] + interface CLLocationButton : NSSecureCoding { + + [Export ("initWithFrame:")] + [DesignatedInitializer] + IntPtr Constructor (CGRect frame); + + [Export ("icon", ArgumentSemantic.Assign)] + CLLocationButtonIcon Icon { get; set; } + + [Export ("label", ArgumentSemantic.Assign)] + CLLocationButtonLabel Label { get; set; } + + [Export ("fontSize")] + nfloat FontSize { get; set; } + + [Export ("cornerRadius")] + nfloat CornerRadius { get; set; } + } +} diff --git a/src/frameworks.sources b/src/frameworks.sources index 25fedf7492bf..40ce72113598 100644 --- a/src/frameworks.sources +++ b/src/frameworks.sources @@ -2034,6 +2034,7 @@ IOS_FRAMEWORKS = \ CoreHaptics \ CoreImage \ CoreLocation \ + CoreLocationUI \ CoreMIDI \ CoreMotion \ CoreNFC \ diff --git a/tests/mtouch/RegistrarTest.cs b/tests/mtouch/RegistrarTest.cs index 5b62b98f2820..fd586a8c3156 100644 --- a/tests/mtouch/RegistrarTest.cs +++ b/tests/mtouch/RegistrarTest.cs @@ -346,6 +346,7 @@ public void MT4134 () new { Framework = "BackgroundTasks", Version = "13.0" }, new { Framework = "QuickLookThumbnailing", Version = "13.0" }, new { Framework = "AutomaticAssessmentConfiguration", Version = "13.4" }, + new { Framework = "CoreLocationUI", Version = "15.0" }, }; foreach (var framework in invalidFrameworks) mtouch.AssertError (4134, $"Your application is using the '{framework.Framework}' framework, which isn't included in the iOS SDK you're using to build your app (this framework was introduced in iOS {framework.Version}, while you're building with the iOS {mtouch.Sdk} SDK.) Please select a newer SDK in your app's iOS Build options."); diff --git a/tests/xtro-sharpie/watchOS-CoreLocationUI.todo b/tests/xtro-sharpie/common-CoreLocationUI.ignore similarity index 83% rename from tests/xtro-sharpie/watchOS-CoreLocationUI.todo rename to tests/xtro-sharpie/common-CoreLocationUI.ignore index 64d259d9b7e0..700862305a7b 100644 --- a/tests/xtro-sharpie/watchOS-CoreLocationUI.todo +++ b/tests/xtro-sharpie/common-CoreLocationUI.ignore @@ -1,2 +1,3 @@ +# no need to be added !missing-field! CoreLocationUIVersionNumber not bound !missing-field! CoreLocationUIVersionString not bound diff --git a/tests/xtro-sharpie/iOS-CoreLocationUI.todo b/tests/xtro-sharpie/iOS-CoreLocationUI.todo deleted file mode 100644 index f94e469de5ab..000000000000 --- a/tests/xtro-sharpie/iOS-CoreLocationUI.todo +++ /dev/null @@ -1,13 +0,0 @@ -!missing-enum! CLLocationButtonIcon not bound -!missing-enum! CLLocationButtonLabel not bound -!missing-field! CoreLocationUIVersionNumber not bound -!missing-field! CoreLocationUIVersionString not bound -!missing-selector! CLLocationButton::cornerRadius not bound -!missing-selector! CLLocationButton::fontSize not bound -!missing-selector! CLLocationButton::icon not bound -!missing-selector! CLLocationButton::label not bound -!missing-selector! CLLocationButton::setCornerRadius: not bound -!missing-selector! CLLocationButton::setFontSize: not bound -!missing-selector! CLLocationButton::setIcon: not bound -!missing-selector! CLLocationButton::setLabel: not bound -!missing-type! CLLocationButton not bound diff --git a/tools/common/Frameworks.cs b/tools/common/Frameworks.cs index 51d88fadf5fa..9f022f683034 100644 --- a/tools/common/Frameworks.cs +++ b/tools/common/Frameworks.cs @@ -418,6 +418,8 @@ public static Frameworks CreateiOSFrameworks (bool is_simulator_build) { "AdServices", "AdServices", 14,3 }, + { "CoreLocationUI", "CoreLocationUI", 15,0 }, + // the above MUST be kept in sync with simlauncher // see tools/mtouch/Makefile // please also keep it sorted to ease comparison @@ -484,6 +486,7 @@ public static Frameworks GetwatchOSFrameworks (bool is_simulator_build) { "Accessibility", "Accessibility", 7,0 }, { "UniformTypeIdentifiers", "UniformTypeIdentifiers", 7,0 }, + }; } return watch_frameworks; diff --git a/tools/mtouch/Makefile b/tools/mtouch/Makefile index 9cfecfc3f96f..3173553f0343 100644 --- a/tools/mtouch/Makefile +++ b/tools/mtouch/Makefile @@ -169,6 +169,8 @@ SIMLAUNCHER_FRAMEWORKS = \ -weak_framework NearbyInteraction \ \ -weak_framework AdServices \ + \ + -weak_framework CoreLocationUI \ # keep the above list of weak_framework # 1. grouped by iOS versions;