mirror of
				https://github.com/yattee/yattee.git
				synced 2025-10-31 04:31:54 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			22 lines
		
	
	
		
			578 B
		
	
	
	
		
			Swift
		
	
	
	
	
	
			
		
		
	
	
			22 lines
		
	
	
		
			578 B
		
	
	
	
		
			Swift
		
	
	
	
	
	
| import SwiftUI
 | |
| 
 | |
| extension Backport where Content: View {
 | |
|     @ViewBuilder func toolbarBackground(_ color: Color) -> some View {
 | |
|         if #available(iOS 16, *) {
 | |
|             content
 | |
|                 .toolbarBackground(color, for: .navigationBar)
 | |
|         } else {
 | |
|             content
 | |
|         }
 | |
|     }
 | |
| 
 | |
|     @ViewBuilder func toolbarBackgroundVisibility(_ visible: Bool) -> some View {
 | |
|         if #available(iOS 16, *) {
 | |
|             content
 | |
|                 .toolbarBackground(visible ? .visible : .hidden, for: .navigationBar)
 | |
|         } else {
 | |
|             content
 | |
|         }
 | |
|     }
 | |
| }
 | 
