1
0
mirror of https://github.com/yattee/yattee.git synced 2024-12-13 22:00:31 +05:30
yattee/Backports/Badge+Backport.swift

16 lines
354 B
Swift
Raw Normal View History

2021-11-28 20:07:55 +05:30
import SwiftUI
extension Backport where Content: View {
2022-12-13 05:09:50 +05:30
@ViewBuilder func badge(_ count: Text?) -> some View {
2022-12-13 17:47:23 +05:30
#if os(tvOS)
2022-12-13 05:09:50 +05:30
content
2022-12-13 17:47:23 +05:30
#else
if #available(iOS 15.0, macOS 12.0, tvOS 15.0, *) {
content.badge(count)
} else {
content
}
#endif
2021-11-28 20:07:55 +05:30
}
}