Update ChatScrollView on WatchOS 10
This commit is contained in:
parent
142d7a38bc
commit
1d964ce68e
|
@ -6,29 +6,23 @@ import SwiftUI
|
||||||
/// We hide the indicators for the flipped scroll view, since they appear reversed.
|
/// We hide the indicators for the flipped scroll view, since they appear reversed.
|
||||||
struct ChatScrollView<Content: View>: View {
|
struct ChatScrollView<Content: View>: View {
|
||||||
private let content: () -> Content
|
private let content: () -> Content
|
||||||
|
|
||||||
init(@ViewBuilder content: @escaping () -> Content) {
|
init(@ViewBuilder content: @escaping () -> Content) {
|
||||||
self.content = content
|
self.content = content
|
||||||
}
|
}
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
ScrollView(showsIndicators: false) {
|
if #available(watchOS 10.0, *) {
|
||||||
content()
|
ScrollView {
|
||||||
.rotationEffect(.degrees(180))
|
content()
|
||||||
|
}
|
||||||
|
.defaultScrollAnchor(.bottom)
|
||||||
|
} else {
|
||||||
|
ScrollView(showsIndicators: false) {
|
||||||
|
content()
|
||||||
|
.rotationEffect(.degrees(180))
|
||||||
|
}
|
||||||
|
.rotationEffect(.degrees(180))
|
||||||
}
|
}
|
||||||
.rotationEffect(.degrees(180))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// if #available(watchOS 10.0, *) {
|
|
||||||
// ScrollView {
|
|
||||||
// content()
|
|
||||||
// }
|
|
||||||
// .defaultScrollAnchor(.bottom)
|
|
||||||
// } else {
|
|
||||||
// ScrollView(showsIndicators: false) {
|
|
||||||
// content()
|
|
||||||
// .rotationEffect(.degrees(180))
|
|
||||||
// }
|
|
||||||
// .rotationEffect(.degrees(180))
|
|
||||||
// }
|
|
||||||
|
|
Loading…
Reference in New Issue