Skip to content

Commit 7336730

Browse files
Improve availability checking (#83)
1 parent 9f15dfe commit 7336730

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Sources/Nodes/ViewControllable/UIKit/UIViewController+ModalStyle.swift

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,12 @@ public struct ModalStyle: Equatable {
1515

1616
case cover, overlay
1717

18-
@available(macCatalyst 13.0, *)
1918
@available(tvOS, unavailable)
2019
case page, form
2120

2221
case custom
2322
}
2423

25-
@available(macCatalyst 13.0, *)
2624
@available(tvOS, unavailable)
2725
public enum SheetStyle: Equatable {
2826

@@ -64,7 +62,6 @@ public struct ModalStyle: Equatable {
6462
allowInteractiveDismissal: false)
6563
}
6664

67-
@available(macCatalyst 13.0, *)
6865
@available(tvOS, unavailable)
6966
public static func sheet(
7067
style sheetStyle: SheetStyle = .page,
@@ -112,15 +109,19 @@ extension UIViewController {
112109
modalPresentationStyle = .fullScreen
113110
case .overlay:
114111
modalPresentationStyle = .overFullScreen
112+
#if !os(tvOS)
115113
case .page:
116114
modalPresentationStyle = .pageSheet
117115
case .form:
118116
modalPresentationStyle = .formSheet
117+
#endif
119118
case .custom:
120119
modalPresentationStyle = .custom
121120
}
121+
#if !os(tvOS)
122122
modalPresentationCapturesStatusBarAppearance = modalStyle.controlStatusBarAppearance
123-
if #available(iOS 13.0, *) {
123+
#endif
124+
if #available(iOS 13.0, tvOS 13.0, *) {
124125
isModalInPresentation = !modalStyle.allowInteractiveDismissal
125126
}
126127
modalStyle.configuration.forEach { $0(self) }

0 commit comments

Comments
 (0)