Skip to content

Commit 2762ffa

Browse files
authored
Add @Frozen Attribute to Public Enums (#147)
* Mark all public enums as frozen * Fix building for Mac Catalyst
1 parent fe2619d commit 2762ffa

22 files changed

+22
-1
lines changed

Sources/Addons/Alert/AlertTextField.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import UIKit
33

44
/// Types of text fields added to the alert.
5+
@frozen
56
public enum AlertTextField: Sendable {
67

78
/// A text field, with text and placeholder customization.

Sources/Addons/HUD/Animation/HUDAnimation.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import UIKit
33

44
/// The animation type that should be used when the ``HUD`` is shown and hidden.
55
@MainActor
6+
@frozen
67
public enum HUDAnimation {
78

89
/// Custom animation for showing and hiding the HUD.

Sources/Addons/HUD/Progress/Animation/ProgressAnimation.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import UIKit
55
///
66
/// An animation is used to update and show the `header`, `indicator` and `footer` parts of the progress view.
77
@MainActor
8+
@frozen
89
public enum ProgressAnimation {
910

1011
/// Custom animation for showing progress view of the HUD.

Sources/Addons/MediaPicker/MediaPickerImageExportPreset.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import UIKit
33

44
/// A type that specifies how to export images to the client application.
5+
@frozen
56
public enum MediaPickerImageExportPreset: Sendable {
67

78
@available(iOS 11, *)

Sources/Addons/MediaPicker/MediaPickerSource.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import UIKit
66
/// A given source may not be available on a given device because the source is not physically present
77
/// or because it cannot currently be accessed.
88
@MainActor
9+
@frozen
910
public enum MediaPickerSource: CustomStringConvertible {
1011

1112
/// Specifies the device’s photo library as the source for the image picker controller.

Sources/Addons/MediaPicker/MediaPickerType.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import MobileCoreServices
1919
/// - Note: If you want to display a Live Photo rendered as a Loop or a Bounce, you must include ``movie`` case.
2020
///
2121
/// To designate all available media types for a source, use a ``MediaPickerSource/availableMediaTypes``.
22+
@frozen
2223
public enum MediaPickerType: Sendable {
2324

2425
/// The designates the still camera interface when capturing media,

Sources/Addons/MediaPicker/ScreenShowMediaPickerAction.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#if canImport(UIKit) && canImport(Photos) && canImport(AVFoundation) && os(iOS)
1+
#if canImport(UIKit) && canImport(Photos) && canImport(AVFoundation) && os(iOS) && !targetEnvironment(macCatalyst)
22
import UIKit
33
import Photos
44
import AVFoundation

Sources/Addons/Sharing/Item/SharingItem.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#if canImport(UIKit) && os(iOS)
22
import UIKit
33

4+
@frozen
45
public enum SharingItem: CustomStringConvertible, @unchecked Sendable {
56

67
case regular(Any)

Sources/Deeplink/DeeplinkType.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import Foundation
22

33
/// Different types of deep links.
4+
@frozen
45
public enum DeeplinkType {
56

67
/// A ``Deeplink`` handled from a URL.

Sources/Screen/Actions/Stack/SetStack/Animations/ScreenStackAnimation.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import UIKit
33

44
@MainActor
5+
@frozen
56
public enum ScreenStackAnimation {
67

78
case `default`

0 commit comments

Comments
 (0)