mirror of https://github.com/oxen-io/session-ios
				
				
				
			
			You cannot select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
	
	
		
			27 lines
		
	
	
		
			830 B
		
	
	
	
		
			Swift
		
	
		
		
			
		
	
	
			27 lines
		
	
	
		
			830 B
		
	
	
	
		
			Swift
		
	
|   
											2 years ago
										 | // Copyright © 2024 Rangeproof Pty Ltd. All rights reserved. | ||
|  | 
 | ||
|  | import SwiftUI | ||
|  | 
 | ||
|  | public struct CompatibleScrollingVStack<Content> : View where Content : View { | ||
|  |     let alignment: HorizontalAlignment | ||
|  |     let spacing: CGFloat? | ||
|  |     let content: () -> Content | ||
|  | 
 | ||
|  |     public init(alignment: HorizontalAlignment = .center, spacing: CGFloat? = nil, | ||
|  |             @ViewBuilder content: @escaping () -> Content) { | ||
|  |         self.alignment = alignment | ||
|  |         self.spacing = spacing | ||
|  |         self.content = content | ||
|  |     } | ||
|  | 
 | ||
|  |     public var body: some View { | ||
|  |         ScrollView { | ||
|  |             if #available(iOS 14, *) { | ||
|  |                 LazyVStack(alignment: alignment, spacing: spacing, pinnedViews: [], content:content) | ||
|  |             } else { | ||
|  |                 VStack(alignment: alignment, spacing: spacing, content:content) | ||
|  |             } | ||
|  |         } | ||
|  |     } | ||
|  | } |