Skip to content

Instantly share code, notes, and snippets.

@vs-mobiletools-engineering-service2
Created December 13, 2022 18:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vs-mobiletools-engineering-service2/f7c3231bf2944035c921bbb2f2a4451c to your computer and use it in GitHub Desktop.
Save vs-mobiletools-engineering-service2/f7c3231bf2944035c921bbb2f2a4451c to your computer and use it in GitHub Desktop.
stable-api-comparison/watchos-api-diff.md
title description author ms.author ms.date ms.topic ms.assetid ms.prod
Xamarin.WatchOS SDK API diff: 16.0.0 vs 16.1.1
List of API changes between Xamarin.WatchOS versions 16.0.0 and 16.1.1.
spouliot
sepoulio
12/13/2022
article
4a1d64a6-a679-2a77-eb45-95481f028ef8
xamarin

Xamarin.WatchOS SDK API diff: 16.0.0 vs 16.1.1

Namespace AVFoundation

Type Changed: AVFoundation.AVAudioRecorder

Obsoleted properties:

 [Obsolete ("Use the 'CurrentTime' property instead.")]
 public virtual double currentTime { get; }

Added property:

public virtual double CurrentTime { get; }

Type Changed: AVFoundation.AVMetadata

Obsoleted properties:

 [Obsolete ("Use 'AVMetadataFormat' enum values.")]
 public static Foundation.NSString FormatHlsMetadata { get; }
 [Obsolete ("Use 'AVMetadataFormat' enum values.")]
 public static Foundation.NSString FormatID3Metadata { get; }
 [Obsolete ("Use 'AVMetadataFormat' enum values.")]
 public static Foundation.NSString FormatQuickTimeUserData { get; }
 [Obsolete ("Use 'AVMetadataFormat' enum values.")]
 public static Foundation.NSString FormatiTunesMetadata { get; }
 [Obsolete ("Use 'AVMetadataFormat' enum values.")]
 public static Foundation.NSString KFormatISOUserData { get; }

Type Changed: AVFoundation.AVPlayer

Obsoleted properties:

 [Obsolete ("Use 'AVPlayerWaitingReason' enum instead.")]
 public static Foundation.NSString WaitingDuringInterstitialEventReason { get; }
 [Obsolete ("Use 'AVPlayerWaitingReason' enum instead.")]
 public static Foundation.NSString WaitingToMinimizeStallsReason { get; }
 [Obsolete ("Use 'AVPlayerWaitingReason' enum instead.")]
 public static Foundation.NSString WaitingWhileEvaluatingBufferingRateReason { get; }
 [Obsolete ("Use 'AVPlayerWaitingReason' enum instead.")]
 public static Foundation.NSString WaitingWithNoItemToPlayReason { get; }

Namespace CoreBluetooth

Type Changed: CoreBluetooth.CBCentralManager

Obsoleted properties:

 [Obsolete ("Use 'CBConnectPeripheralOptions' instead.")]
 public static Foundation.NSString OptionNotifyOnConnectionKey { get; }
 [Obsolete ("Use 'CBConnectPeripheralOptions' instead.")]
 public static Foundation.NSString OptionNotifyOnDisconnectionKey { get; }
 [Obsolete ("Use 'CBConnectPeripheralOptions' instead.")]
 public static Foundation.NSString OptionNotifyOnNotificationKey { get; }

Namespace CoreFoundation

Type Changed: CoreFoundation.CFSocket

Added properties:

public System.Net.IPEndPoint Address { get; }
public System.Net.IPEndPoint RemoteAddress { get; }

Added method:

public void Invalidate ();

Namespace CoreLocation

Type Changed: CoreLocation.CLError

Added value:

HistoricalLocationError = 19,

Type Changed: CoreLocation.CLLocationManager

Added method:

public virtual void RequestHistoricalLocations (string purposeKey, nint sampleCount, RequestHistoricalLocationsCompletionHandler handler);

New Type: CoreLocation.RequestHistoricalLocationsCompletionHandler

public sealed delegate RequestHistoricalLocationsCompletionHandler : System.MulticastDelegate {
	// constructors
	public RequestHistoricalLocationsCompletionHandler (object object, IntPtr method);
	// methods
	public virtual System.IAsyncResult BeginInvoke (CLLocation[] locations, Foundation.NSError error, System.AsyncCallback callback, object object);
	public virtual void EndInvoke (System.IAsyncResult result);
	public virtual void Invoke (CLLocation[] locations, Foundation.NSError error);
}

Namespace CoreMedia

Type Changed: CoreMedia.CMSampleBufferAttachmentKey

Added value:

Hdr10PlusPerFrameData = 34,

Type Changed: CoreMedia.CMSampleBufferAttachmentSettings

Added property:

public Foundation.NSData Hdr10PlusPerFrameData { get; set; }

Namespace CoreMotion

New Type: CoreMotion.CMWaterSubmersionDepthState

[Serializable]
public enum CMWaterSubmersionDepthState {
	ApproachingMaxDepth = 400,
	NotSubmerged = 100,
	PastMaxDepth = 500,
	SensorDepthError = 600,
	SubmergedDeep = 300,
	SubmergedShallow = 200,
	Unknown = 0,
}

New Type: CoreMotion.CMWaterSubmersionEvent

public class CMWaterSubmersionEvent : Foundation.NSObject, Foundation.INSCoding, Foundation.INSCopying, Foundation.INSSecureCoding, ObjCRuntime.INativeObject, System.IDisposable {
	// constructors
	public CMWaterSubmersionEvent ();
	public CMWaterSubmersionEvent (Foundation.NSCoder coder);
	protected CMWaterSubmersionEvent (Foundation.NSObjectFlag t);
	protected CMWaterSubmersionEvent (IntPtr handle);
	// properties
	public override IntPtr ClassHandle { get; }
	public virtual Foundation.NSDate Date { get; }
	public virtual CMWaterSubmersionState State { get; }
	// methods
	public virtual Foundation.NSObject Copy (Foundation.NSZone zone);
	public virtual void EncodeTo (Foundation.NSCoder encoder);
}

New Type: CoreMotion.CMWaterSubmersionManager

public class CMWaterSubmersionManager : Foundation.NSObject {
	// constructors
	public CMWaterSubmersionManager ();
	protected CMWaterSubmersionManager (Foundation.NSObjectFlag t);
	protected CMWaterSubmersionManager (IntPtr handle);
	// properties
	public static CMAuthorizationStatus AuthorizationStatus { get; }
	public override IntPtr ClassHandle { get; }
	public ICMWaterSubmersionManagerDelegate Delegate { get; set; }
	public static bool IsWaterSubmersionAvailable { get; }
	public virtual Foundation.NSObject WeakDelegate { get; set; }
	// methods
	protected override void Dispose (bool disposing);
}

New Type: CoreMotion.CMWaterSubmersionManagerDelegate

public abstract class CMWaterSubmersionManagerDelegate : Foundation.NSObject, ICMWaterSubmersionManagerDelegate, ObjCRuntime.INativeObject, System.IDisposable {
	// constructors
	protected CMWaterSubmersionManagerDelegate ();
	protected CMWaterSubmersionManagerDelegate (Foundation.NSObjectFlag t);
	protected CMWaterSubmersionManagerDelegate (IntPtr handle);
	// methods
	public virtual void DidUpdateEvent (CMWaterSubmersionManager manager, CMWaterSubmersionEvent event);
	public virtual void DidUpdateMeasurement (CMWaterSubmersionManager manager, CMWaterSubmersionMeasurement measurement);
	public virtual void DidUpdateTemperature (CMWaterSubmersionManager manager, CMWaterTemperature measurement);
	public virtual void ErrorOccurred (CMWaterSubmersionManager manager, Foundation.NSError error);
}

New Type: CoreMotion.CMWaterSubmersionMeasurement

public class CMWaterSubmersionMeasurement : Foundation.NSObject, Foundation.INSCoding, Foundation.INSCopying, Foundation.INSSecureCoding, ObjCRuntime.INativeObject, System.IDisposable {
	// constructors
	public CMWaterSubmersionMeasurement ();
	public CMWaterSubmersionMeasurement (Foundation.NSCoder coder);
	protected CMWaterSubmersionMeasurement (Foundation.NSObjectFlag t);
	protected CMWaterSubmersionMeasurement (IntPtr handle);
	// properties
	public override IntPtr ClassHandle { get; }
	public virtual Foundation.NSDate Date { get; }
	public virtual Foundation.NSMeasurement<Foundation.NSUnitLength> Depth { get; }
	public virtual Foundation.NSMeasurement<Foundation.NSUnitPressure> Pressure { get; }
	public virtual CMWaterSubmersionDepthState SubmersionState { get; }
	public virtual Foundation.NSMeasurement<Foundation.NSUnitPressure> SurfacePressure { get; }
	// methods
	public virtual Foundation.NSObject Copy (Foundation.NSZone zone);
	public virtual void EncodeTo (Foundation.NSCoder encoder);
}

New Type: CoreMotion.CMWaterSubmersionState

[Serializable]
public enum CMWaterSubmersionState {
	NotSubmerged = 1,
	Submerged = 2,
	Unknown = 0,
}

New Type: CoreMotion.CMWaterTemperature

public class CMWaterTemperature : Foundation.NSObject, Foundation.INSCoding, Foundation.INSCopying, Foundation.INSSecureCoding, ObjCRuntime.INativeObject, System.IDisposable {
	// constructors
	public CMWaterTemperature ();
	public CMWaterTemperature (Foundation.NSCoder coder);
	protected CMWaterTemperature (Foundation.NSObjectFlag t);
	protected CMWaterTemperature (IntPtr handle);
	// properties
	public override IntPtr ClassHandle { get; }
	public virtual Foundation.NSDate Date { get; }
	public virtual Foundation.NSMeasurement<Foundation.NSUnitTemperature> Temperature { get; }
	public virtual Foundation.NSMeasurement<Foundation.NSUnitTemperature> TemperatureUncertainty { get; }
	// methods
	public virtual Foundation.NSObject Copy (Foundation.NSZone zone);
	public virtual void EncodeTo (Foundation.NSCoder encoder);
}

New Type: CoreMotion.ICMWaterSubmersionManagerDelegate

public interface ICMWaterSubmersionManagerDelegate : ObjCRuntime.INativeObject, System.IDisposable {
	// methods
	public virtual void DidUpdateEvent (CMWaterSubmersionManager manager, CMWaterSubmersionEvent event);
	public virtual void DidUpdateMeasurement (CMWaterSubmersionManager manager, CMWaterSubmersionMeasurement measurement);
	public virtual void DidUpdateTemperature (CMWaterSubmersionManager manager, CMWaterTemperature measurement);
	public virtual void ErrorOccurred (CMWaterSubmersionManager manager, Foundation.NSError error);
}

Namespace Foundation

Type Changed: Foundation.NSArray

Added interfaces:

System.Collections.Generic.IEnumerable<NSObject>
System.Collections.IEnumerable

Added methods:

public TKey[] ToArray<TKey> ();
public NSObject[] ToArray ();

Type Changed: Foundation.NSArray`1

Added method:

public TKey[] ToArray ();

Type Changed: Foundation.NSAttributedString

Obsoleted methods:

 [Obsolete ("Use 'GetData' instead.")]
 public NSData GetDataFromRange (NSRange range, NSAttributedStringDocumentAttributes documentAttributes, ref NSError error);
 [Obsolete ("Use 'GetData' instead.")]
 public virtual NSData GetDataFromRange (NSRange range, NSDictionary attributes, ref NSError error);
 [Obsolete ("Use 'GetFileWrapper' instead.")]
 public NSFileWrapper GetFileWrapperFromRange (NSRange range, NSAttributedStringDocumentAttributes documentAttributes, ref NSError error);
 [Obsolete ("Use 'GetFileWrapper' instead.")]
 public virtual NSFileWrapper GetFileWrapperFromRange (NSRange range, NSDictionary attributes, ref NSError error);

Added methods:

public NSData GetData (NSRange range, NSAttributedStringDocumentAttributes options, out NSError error);
public NSData GetData (NSRange range, NSDictionary options, out NSError error);
public NSFileWrapper GetFileWrapper (NSRange range, NSAttributedStringDocumentAttributes options, out NSError error);
public NSFileWrapper GetFileWrapper (NSRange range, NSDictionary options, out NSError error);

Type Changed: Foundation.NSBundle

Obsoleted properties:

 [Obsolete ("Use the 'AllBundles' property instead.")]
 public static NSBundle[] _AllBundles { get; }

Added property:

public static NSBundle[] AllBundles { get; }

Type Changed: Foundation.NSMutableUrlRequest

Added property:

public virtual bool RequiresDnsSecValidation { get; set; }

Type Changed: Foundation.NSOperatingSystemVersion

Added constructors:

public NSOperatingSystemVersion (nint major);
public NSOperatingSystemVersion (nint major, nint minor);

Added interfaces:

System.IComparable
System.IEquatable<NSOperatingSystemVersion>

Added methods:

public int CompareTo (NSOperatingSystemVersion otherVersion);
public virtual int CompareTo (object obj);
public virtual bool Equals (NSOperatingSystemVersion other);
public override bool Equals (object obj);
public override int GetHashCode ();
public static bool op_Equality (NSOperatingSystemVersion os1, NSOperatingSystemVersion os2);
public static bool op_Inequality (NSOperatingSystemVersion os1, NSOperatingSystemVersion os2);

Type Changed: Foundation.NSRunLoop

Obsoleted properties:

 [Obsolete ("Use the 'NSRunLoopMode' enum instead.")]
 public static NSString NSDefaultRunLoopMode { get; }
 [Obsolete ("Use the 'NSRunLoopMode' enum instead.")]
 public static NSString NSRunLoopCommonModes { get; }

Type Changed: Foundation.NSUrlRequest

Added property:

public virtual bool RequiresDnsSecValidation { get; }

Namespace HealthKit

Type Changed: HealthKit.HKCategoryTypeIdentifier

Added values:

InfrequentMenstrualCycles = 62,
IrregularMenstrualCycles = 63,
PersistentIntermenstrualBleeding = 64,
ProlongedMenstrualPeriods = 65,

Type Changed: HealthKit.HKQuantityTypeIdentifier

Added values:

AppleSleepingWristTemperature = 100,
UnderwaterDepth = 101,
WaterTemperature = 102,

Namespace HomeKit

Type Changed: HomeKit.HMAccessory

Added property:

public virtual Foundation.NSNumber MatterNodeId { get; }

Type Changed: HomeKit.HMAccessorySetupManager

Obsoleted methods:

 [Obsolete ("This API has been removed from the 'HomeKit' framework.")]
 public virtual void AddAndSetUpAccessories (HMChipServiceTopology topology, HMErrorHandler completion);
 [Obsolete ("This API has been removed from the 'HomeKit' framework.")]
 public virtual System.Threading.Tasks.Task AddAndSetUpAccessoriesAsync (HMChipServiceTopology topology);

Type Changed: HomeKit.HMHome

Added properties:

public virtual string MatterControllerId { get; }
public virtual System.Func<Foundation.NSXpcConnection> MatterControllerXPCConnectBlock { get; }

Namespace NearbyInteraction

Type Changed: NearbyInteraction.NISession

Obsoleted methods:

 [Obsolete ("This method was removed and will always throw a InvalidOperationException.")]
 public virtual OpenTK.NMatrix4 GetWorldTransform (NINearbyObject object);
 [Obsolete ("This method was removed and will always throw a InvalidOperationException.")]
 public virtual void SetARSession (Foundation.NSObject session);

Namespace Network

Type Changed: Network.NWDataTransferReport

Obsoleted methods:

 [Obsolete ("Use the 'GetPathRadioType' property instead.")]
 public NWInterfaceRadioType get_path_radio_type (uint pathIndex);

Added method:

public NWInterfaceRadioType GetPathRadioType (uint pathIndex);

Type Changed: Network.NWPath

Obsoleted methods:

 [Obsolete ("Use the overload that takes a 'Func<NWEndpoint, bool>' instead.")]
 public void EnumerateGateways (System.Action<NWEndpoint> callback);
 [Obsolete ("Use the overload that takes a 'Func<NWInterface, bool>' instead.")]
 public void EnumerateInterfaces (System.Action<NWInterface> callback);

Added methods:

public void EnumerateGateways (System.Func<NWEndpoint,System.Boolean> callback);
public void EnumerateInterfaces (System.Func<NWInterface,System.Boolean> callback);

Namespace ObjCRuntime

Type Changed: ObjCRuntime.Constants

Modified fields:

-public const string SdkVersion = "9.0";
+public const string SdkVersion = "9.1";
-public const string Version = "16.0.0";
+public const string Version = "16.1.1";

Namespace SceneKit

Type Changed: SceneKit.SCNHitTest

Obsoleted properties:

 [Obsolete ("Use 'SearchModeKey' instead.")]
 public static Foundation.NSString OptionSearchModeKey { get; }

Namespace UIKit

Type Changed: UIKit.UIFont

Obsoleted properties:

 [Obsolete ("Use the 'XHeight' property instead.")]
 public virtual nfloat xHeight { get; }

Added property:

public virtual nfloat XHeight { get; }

New Type: UIKit.UIFontWeightConstants

public static class UIFontWeightConstants {
	// properties
	public static nfloat Black { get; }
	public static nfloat Bold { get; }
	public static nfloat Heavy { get; }
	public static nfloat Light { get; }
	public static nfloat Medium { get; }
	public static nfloat Regular { get; }
	public static nfloat Semibold { get; }
	public static nfloat Thin { get; }
	public static nfloat UltraLight { get; }
}

New Type: UIKit.UIFontWeightExtensions

public static class UIFontWeightExtensions {
	// methods
	public static nfloat GetWeight (this UIFontWeight weight);
}

Namespace WatchKit

Type Changed: WatchKit.WKExtendedRuntimeSession

Added methods:

public static void RequestAutoLaunchAuthorizationStatus (WKRequestAutoLaunchAuthorizationStatusCompletionHandler completion);
public static System.Threading.Tasks.Task<WKExtendedRuntimeSessionAutoLaunchAuthorizationStatus> RequestAutoLaunchAuthorizationStatusAsync ();

Type Changed: WatchKit.WKExtendedRuntimeSessionErrorCode

Added values:

MustBeActiveToPrompt = 9,
UnsupportedSessionType = 10,

Type Changed: WatchKit.WKHapticType

Added values:

UnderwaterDepthCriticalPrompt = 13,
UnderwaterDepthPrompt = 12,

Type Changed: WatchKit.WKWaterResistanceRating

Added value:

WR100 = 2,

New Type: WatchKit.WKExtendedRuntimeSessionAutoLaunchAuthorizationStatus

[Serializable]
public enum WKExtendedRuntimeSessionAutoLaunchAuthorizationStatus {
	Active = 2,
	Inactive = 1,
	Unknown = 0,
}

New Type: WatchKit.WKRequestAutoLaunchAuthorizationStatusCompletionHandler

public sealed delegate WKRequestAutoLaunchAuthorizationStatusCompletionHandler : System.MulticastDelegate {
	// constructors
	public WKRequestAutoLaunchAuthorizationStatusCompletionHandler (object object, IntPtr method);
	// methods
	public virtual System.IAsyncResult BeginInvoke (WKExtendedRuntimeSessionAutoLaunchAuthorizationStatus authorizationStatus, Foundation.NSError error, System.AsyncCallback callback, object object);
	public virtual void EndInvoke (System.IAsyncResult result);
	public virtual void Invoke (WKExtendedRuntimeSessionAutoLaunchAuthorizationStatus authorizationStatus, Foundation.NSError error);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment