-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extend conformances Photos, StoreKit, UIKit (#1)
* Conform UIScrollView.ContentInsetAdjustmentBehavior * Conform some Photos enums * Conform some StoreKit enums * Update Sources/CustomDump/Conformances/UIKit.swift * Fix availability Co-authored-by: Stephen Celis <[email protected]> Co-authored-by: Stephen Celis <[email protected]>
- Loading branch information
1 parent
4f743ea
commit 8655495
Showing
3 changed files
with
98 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#if canImport(Photos) | ||
import Photos | ||
|
||
@available(iOS 14, macCatalyst 14, macOS 11, tvOS 14, *) | ||
extension PHAccessLevel: CustomDumpStringConvertible { | ||
public var customDumpDescription: String { | ||
switch self { | ||
case .addOnly: | ||
return "PHAccessLevel.addOnly" | ||
case .readWrite: | ||
return "PHAccessLevel.readWrite" | ||
@unknown default: | ||
return "PHAccessLevel.(@unknown default, rawValue: \(self.rawValue))" | ||
} | ||
} | ||
} | ||
|
||
@available(iOS 8, macCatalyst 13, macOS 10.13, tvOS 10, *) | ||
extension PHAuthorizationStatus: CustomDumpStringConvertible { | ||
public var customDumpDescription: String { | ||
switch self { | ||
case .authorized: | ||
return "PHAuthorizationStatus.authorized" | ||
case .denied: | ||
return "PHAuthorizationStatus.denied" | ||
case .notDetermined: | ||
return "PHAuthorizationStatus.notDetermined" | ||
case .restricted: | ||
return "PHAuthorizationStatus.restricted" | ||
case .limited: | ||
return "PHAuthorizationStatus.limited" | ||
@unknown default: | ||
return "PHAuthorizationStatus.(@unknown default, rawValue: \(self.rawValue))" | ||
} | ||
} | ||
} | ||
|
||
#endif |
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,41 @@ | ||
#if canImport(StoreKit) | ||
import StoreKit | ||
|
||
@available(iOS 3, macCatalyst 13, macOS 10.7, tvOS 9, watchOS 6.2, *) | ||
extension SKPaymentTransactionState: CustomDumpStringConvertible { | ||
public var customDumpDescription: String { | ||
switch self { | ||
case .purchasing: | ||
return "SKPaymentTransactionState.purchasing" | ||
case .purchased: | ||
return "SKPaymentTransactionState.purchased" | ||
case .failed: | ||
return "SKPaymentTransactionState.failed" | ||
case .restored: | ||
return "SKPaymentTransactionState.restored" | ||
case .deferred: | ||
return "SKPaymentTransactionState.deferred" | ||
@unknown default: | ||
return "SKPaymentTransactionState.(@unknown default, rawValue: \(self.rawValue))" | ||
} | ||
} | ||
} | ||
|
||
@available(iOS 11.2, macCatalyst 13, macOS 10.13.2, tvOS 11.2, watchOS 6.2, *) | ||
extension SKProduct.PeriodUnit: CustomDumpStringConvertible { | ||
public var customDumpDescription: String { | ||
switch self { | ||
case .day: | ||
return "SKProduct.PeriodUnit.day" | ||
case .week: | ||
return "SKProduct.PeriodUnit.week" | ||
case .month: | ||
return "SKProduct.PeriodUnit.month" | ||
case .year: | ||
return "SKProduct.PeriodUnit.year" | ||
@unknown default: | ||
return "SKProduct.PeriodUnit.(@unknown default, rawValue: \(self.rawValue))" | ||
} | ||
} | ||
} | ||
#endif |
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