Fix badge backport for tvOS

This commit is contained in:
Arkadiusz Fal
2022-12-13 13:17:23 +01:00
parent b3ddf4a153
commit 93c9298c07
2 changed files with 10 additions and 4 deletions

View File

@@ -2,10 +2,14 @@ import SwiftUI
extension Backport where Content: View {
@ViewBuilder func badge(_ count: Text?) -> some View {
if #available(iOS 15.0, macOS 12.0, tvOS 15.0, *) {
content.badge(count)
} else {
#if os(tvOS)
content
}
#else
if #available(iOS 15.0, macOS 12.0, tvOS 15.0, *) {
content.badge(count)
} else {
content
}
#endif
}
}