diff options
| author | Fuwn <[email protected]> | 2025-03-15 20:37:05 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2025-03-15 20:37:05 -0700 |
| commit | 8eae995c5bf475b2e40a807dbdf8927dbd993222 (patch) | |
| tree | 9d89f0e2c3f5f856429312cebd1cde9bb107cc55 /Sora/Views/PlatformSpecificToolbarItem.swift | |
| parent | feat: Development commit (diff) | |
| download | sora-testing-8eae995c5bf475b2e40a807dbdf8927dbd993222.tar.xz sora-testing-8eae995c5bf475b2e40a807dbdf8927dbd993222.zip | |
feat: Development commit
Diffstat (limited to 'Sora/Views/PlatformSpecificToolbarItem.swift')
| -rw-r--r-- | Sora/Views/PlatformSpecificToolbarItem.swift | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/Sora/Views/PlatformSpecificToolbarItem.swift b/Sora/Views/PlatformSpecificToolbarItem.swift new file mode 100644 index 0000000..7c2fb86 --- /dev/null +++ b/Sora/Views/PlatformSpecificToolbarItem.swift @@ -0,0 +1,21 @@ +import SwiftUI + +struct PlatformSpecificToolbarItem<Content: View>: ToolbarContent { + let content: () -> Content + + init(@ViewBuilder content: @escaping () -> Content) { + self.content = content + } + + var body: some ToolbarContent { + #if os(macOS) + ToolbarItem { + content() + } + #else + ToolbarItem(placement: .bottomBar) { + content() + } + #endif + } +} |