EnesKaraosman / SwiftyChat

SwiftUI Chat UI (Client) Framework & Documentation to get started!
Apache License 2.0
284 stars 54 forks source link

scrollToBottom using onRecieve #25

Closed seniorAyman closed 2 years ago

seniorAyman commented 2 years ago

when I added this part

.onReceive( messages.debounce(for: .milliseconds(650), scheduler: RunLoop.main), perform: { _ in scrollToBottom = true } )

I got a lot of errors Cannot call value of non-function type 'Binding' Cannot infer contextual base in reference to member 'milliseconds' Referencing subscript 'subscript(dynamicMember:)' requires wrapper 'Binding<[MockMessages.ChatMessageItem]>' Insert '$' Value of type '[MockMessages.ChatMessageItem]' has no dynamic member 'debounce' using key path from root type '[MockMessages.ChatMessageItem]'

please advise regards

EnesKaraosman commented 2 years ago

try using with $messages.debounce...

seniorAyman commented 2 years ago

now the errors become like this

Cannot call value of non-function type 'Binding' Cannot infer contextual base in reference to member 'milliseconds' Value of type 'Binding<[MockMessages.ChatMessageItem]>' has no dynamic member 'debounce' using key path from root type '[MockMessages.ChatMessageItem]'

seniorAyman commented 2 years ago

@EnesKaraosman