Skip to main content
AI Assist is now on Stack Overflow. Start a chat to get instant answers from across the network. Sign up to save and share your chats.
deleted 20 characters in body
Source Link
Wissa
  • 1.6k
  • 25
  • 26

For iOS 16+

Now SwiftUI Added the .refreshable modifier to ScrollView.

Just use it the way you do with List

ScrollView { LazyVStack { // Loop and add View } } .refreshable { refreshLogic() } 

Its supported starting iOS 16 though.

Here is the documentation reference

@available(iOS 15.0, macOS 12.0, tvOS 15.0, watchOS 8.0, *) extension View { /// Marks this view as refreshable. public func refreshable(action: @escaping @Sendable () async -> Void) -> some View } 

Now SwiftUI Added the .refreshable modifier to ScrollView.

Just use it the way you do with List

ScrollView { LazyVStack { // Loop and add View } } .refreshable { refreshLogic() } 

Its supported starting iOS 16 though.

Here is the documentation reference

@available(iOS 15.0, macOS 12.0, tvOS 15.0, watchOS 8.0, *) extension View { /// Marks this view as refreshable. public func refreshable(action: @escaping @Sendable () async -> Void) -> some View } 

For iOS 16+

Now SwiftUI Added the .refreshable modifier to ScrollView.

Just use it the way you do with List

ScrollView { LazyVStack { // Loop and add View } } .refreshable { refreshLogic() } 

Here is the documentation reference

@available(iOS 15.0, macOS 12.0, tvOS 15.0, watchOS 8.0, *) extension View { /// Marks this view as refreshable. public func refreshable(action: @escaping @Sendable () async -> Void) -> some View } 
edited body
Source Link
Wissa
  • 1.6k
  • 25
  • 26

Now SwiftUI Added the .refreshable modifier to ScrollView.

Just use it the way you do with List

ScrollView { LazyVStack { // Loop and add View } } .refreshable { refreshLogic() } 

Its supported starting iOS 1516 though.

Here is the documentation reference

@available(iOS 15.0, macOS 12.0, tvOS 15.0, watchOS 8.0, *) extension View { /// Marks this view as refreshable. public func refreshable(action: @escaping @Sendable () async -> Void) -> some View } 

Now SwiftUI Added the .refreshable modifier to ScrollView.

Just use it the way you do with List

ScrollView { LazyVStack { // Loop and add View } } .refreshable { refreshLogic() } 

Its supported starting iOS 15 though.

Here is the documentation reference

@available(iOS 15.0, macOS 12.0, tvOS 15.0, watchOS 8.0, *) extension View { /// Marks this view as refreshable. public func refreshable(action: @escaping @Sendable () async -> Void) -> some View } 

Now SwiftUI Added the .refreshable modifier to ScrollView.

Just use it the way you do with List

ScrollView { LazyVStack { // Loop and add View } } .refreshable { refreshLogic() } 

Its supported starting iOS 16 though.

Here is the documentation reference

@available(iOS 15.0, macOS 12.0, tvOS 15.0, watchOS 8.0, *) extension View { /// Marks this view as refreshable. public func refreshable(action: @escaping @Sendable () async -> Void) -> some View } 
added 301 characters in body
Source Link
Wissa
  • 1.6k
  • 25
  • 26

Now SwiftUI Added the .refreshable modifier to ScrollView.

Just use it the way you do with List

ScrollView { LazyVStack { // Loop and add View } } .refreshable { refreshLogic() } 

Its supported starting iOS 15 though.

Here is the documentation reference

@available(iOS 15.0, macOS 12.0, tvOS 15.0, watchOS 8.0, *) extension View { /// Marks this view as refreshable. public func refreshable(action: @escaping @Sendable () async -> Void) -> some View } 

Now SwiftUI Added the .refreshable modifier to ScrollView.

Just use it the way you do with List

ScrollView { LazyVStack { // Loop and add View } } .refreshable { refreshLogic() } 

Now SwiftUI Added the .refreshable modifier to ScrollView.

Just use it the way you do with List

ScrollView { LazyVStack { // Loop and add View } } .refreshable { refreshLogic() } 

Its supported starting iOS 15 though.

Here is the documentation reference

@available(iOS 15.0, macOS 12.0, tvOS 15.0, watchOS 8.0, *) extension View { /// Marks this view as refreshable. public func refreshable(action: @escaping @Sendable () async -> Void) -> some View } 
Source Link
Wissa
  • 1.6k
  • 25
  • 26
Loading