-
Notifications
You must be signed in to change notification settings - Fork 520
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PassKit] Implement Xcode 16.0 beta 1-6 changes. (#21139)
Note: there were no changes in beta 3, beta 4 or beta 5.
- Loading branch information
1 parent
17d27c9
commit f7bddc6
Showing
18 changed files
with
383 additions
and
296 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#nullable enable | ||
|
||
#if !WATCH | ||
|
||
using System; | ||
using Foundation; | ||
using ObjCRuntime; | ||
|
||
namespace PassKit { | ||
|
||
/// <summary>This enum is used to select how to initialize a new instance of a <see cref="PKJapanIndividualNumberCardMetadata" />.</summary> | ||
public enum PKJapanIndividualNumberCardMetadataConstructorOption { | ||
/// <summary>The <c>cardIdentifier</c> parameter passed to the constructor is an card template identifier.</summary> | ||
CardTemplateIdentifier, | ||
/// <summary>The <c>cardIdentifier</c> parameter passed to the constructor is an card configuration identifier.</summary> | ||
CardConfigurationIdentifier, | ||
} | ||
|
||
public partial class PKJapanIndividualNumberCardMetadata { | ||
public PKJapanIndividualNumberCardMetadata (string credentialIdentifier, string sharingInstanceIdentifier, string cardIdentifier, PKAddPassMetadataPreview preview, PKJapanIndividualNumberCardMetadataConstructorOption option) | ||
: base (NSObjectFlag.Empty) | ||
{ | ||
switch (option) { | ||
case PKJapanIndividualNumberCardMetadataConstructorOption.CardTemplateIdentifier: | ||
InitializeHandle (_InitWithProvisioningCredentialIdentifier_CardTemplateIdentifier (credentialIdentifier, sharingInstanceIdentifier, cardIdentifier, preview)); ; | ||
break; | ||
case PKJapanIndividualNumberCardMetadataConstructorOption.CardConfigurationIdentifier: | ||
InitializeHandle (_InitWithProvisioningCredentialIdentifier_CardConfigurationIdentifier (credentialIdentifier, sharingInstanceIdentifier, cardIdentifier, preview)); | ||
break; | ||
default: | ||
throw new ArgumentOutOfRangeException (nameof (option), option, "Invalid enum value."); | ||
} | ||
} | ||
} | ||
} | ||
#endif // !WATCH |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
using System; | ||
using System.Runtime.Versioning; | ||
|
||
using ObjCRuntime; | ||
|
||
#nullable enable | ||
|
||
#if !NET | ||
using NativeHandle = System.IntPtr; | ||
#endif | ||
|
||
#if !TVOS | ||
|
||
namespace PassKit { | ||
/* | ||
* PKMerchantCategoryCode is defined like this: | ||
* | ||
* typedef SInt16 PKMerchantCategoryCode NS_TYPED_EXTENSIBLE_ENUM NS_REFINED_FOR_SWIFT API_AVAILABLE(macos(15.0), ios(18.0), watchos(11.0)); | ||
* extern PKMerchantCategoryCode const PKMerchantCategoryCodeNone API_AVAILABLE(macos(15.0), ios(18.0), watchos(11.0)); | ||
* | ||
* In other words: like a strongly typed enum, just with 'short' as the backing type instead of 'NSString'. | ||
* | ||
* Since we can't model this as an enum in C# (because the values aren't constant), instead create a custom struct with a short field. | ||
*/ | ||
|
||
/// <summary>The four-digit type, in ISO 18245 format, that represents the type of goods or service a merchant provides for a transaction.</summary> | ||
#if NET | ||
[SupportedOSPlatform ("macos15.0")] | ||
[SupportedOSPlatform ("ios18.0")] | ||
[SupportedOSPlatform ("maccatalyst18.0")] | ||
[UnsupportedOSPlatform ("tvos")] | ||
#else | ||
[Mac (15, 0), iOS (18, 0), NoTV, MacCatalyst (18, 0), Watch (11, 0)] | ||
#endif | ||
public struct PKMerchantCategoryCode { | ||
short value; | ||
|
||
#if !COREBUILD | ||
/// <summary>A <see cref="PKMerchantCategoryCode" /> representing no merchant code.</summary> | ||
public static PKMerchantCategoryCode None { get => new PKMerchantCategoryCode (PKMerchantCategoryCodeValues.None); } | ||
#endif | ||
|
||
/// <summary>Create a <see cref="PKMerchantCategoryCode" /> for the specified merchant code.</summary> | ||
/// <param name="code">The 16-bit merchant code.</param> | ||
public PKMerchantCategoryCode (short code) | ||
{ | ||
value = code; | ||
} | ||
|
||
/// <summary>Get the 16-bit value for this <see cref="PKMerchantCategoryCode" />.</summary> | ||
public short Value { | ||
get { | ||
return this.Value; | ||
} | ||
} | ||
|
||
/// <summary>Get the 16-bit value for a <see cref="PKMerchantCategoryCode" />.</summary> | ||
public static explicit operator short (PKMerchantCategoryCode code) | ||
{ | ||
return code.Value; | ||
} | ||
|
||
/// <summary>Convert a 16-bit value to a <see cref="PKMerchantCategoryCode" />.</summary> | ||
public static explicit operator PKMerchantCategoryCode (short code) | ||
{ | ||
return new PKMerchantCategoryCode (code); | ||
} | ||
} | ||
} | ||
#endif // !TVOS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
This comment was marked as outdated.
Sorry, something went wrong.
This comment was marked as outdated.
Sorry, something went wrong.
This comment was marked as outdated.
Sorry, something went wrong.
This comment was marked as outdated.
Sorry, something went wrong.