builds
parent
4154f8f46d
commit
1275ad4f96
|
@ -59,6 +59,7 @@ func goToRibbon(selectedRibbon: Ribbon,
|
|||
print("switching ribbons")
|
||||
|
||||
paneConnector.wrappedValue.showOverlay = true
|
||||
showOverlay.wrappedValue = true
|
||||
|
||||
if loading {
|
||||
paneConnector.wrappedValue.currentId = destRibbon.scrollId
|
||||
|
@ -208,8 +209,10 @@ struct ContentView: View {
|
|||
@State var scrollId: String?
|
||||
@State var scrollOffset: CGFloat?
|
||||
@State var setScrollOffset: CGFloat?
|
||||
@State var foocat = "meow"
|
||||
@State var showOverlay: Bool = false
|
||||
@State var refresh: Bool = false
|
||||
@State var refresh3: Bool = false
|
||||
|
||||
@State var vertSep = CGFloat(20)
|
||||
|
||||
|
@ -325,9 +328,13 @@ struct ContentView: View {
|
|||
var curOffset = gTracker.visibleViews[paneConnector.scrollId]
|
||||
Print(" stats", gTracker.visibleViews)
|
||||
if curOffset != nil {
|
||||
setScrollOffset = CGFloat(Int(paneConnector.scrollOffset) - Int(curOffset!))
|
||||
paneConnector.setScrollOffset = CGFloat(Int(paneConnector.scrollOffset) - Int(curOffset!))
|
||||
// setScrollOffset = CGFloat(Int(paneConnector.scrollOffset) - Int(curOffset!))
|
||||
// setScrollOffset = CGFloat(Int(paneConnector.scrollOffset) - Int(curOffset!))
|
||||
Print("applying scroll offset \(setScrollOffset)")
|
||||
refresh2.toggle()
|
||||
Print("applying scroll offset \(paneConnector.setScrollOffset)")
|
||||
Print("applying scroll offset2 \(foocat)")
|
||||
self.refresh.toggle()
|
||||
} else {
|
||||
var adjust = (Int(paneConnector.scrollId)! - Int(paneConnector.currentId)!) * 200
|
||||
Print("adjusting \(adjust)")
|
||||
|
@ -339,15 +346,22 @@ struct ContentView: View {
|
|||
}
|
||||
}
|
||||
}
|
||||
.introspect(.scrollView, on: .iOS(.v13, .v14, .v15, .v16, .v17)) { scrollView in Print("introspect")
|
||||
if setScrollOffset != nil {
|
||||
DispatchQueue.main.async {
|
||||
scrollView.contentOffset.y = scrollView.contentOffset.y + setScrollOffset!
|
||||
setScrollOffset = nil
|
||||
.introspect(.scrollView, on: .iOS(.v13, .v14, .v15, .v16, .v17)) { scrollView in
|
||||
Print("introspect")
|
||||
|
||||
// self.showOverlay = false
|
||||
withAnimation {
|
||||
// Weird hack for reactivity
|
||||
if self.refresh {
|
||||
let reactive = self.refresh
|
||||
}
|
||||
|
||||
if paneConnector.setScrollOffset != nil {
|
||||
DispatchQueue.main.async {
|
||||
scrollView.contentOffset.y = scrollView.contentOffset.y + paneConnector.setScrollOffset!
|
||||
paneConnector.setScrollOffset = nil
|
||||
|
||||
withAnimation(.easeIn(duration: 0.2)) {
|
||||
paneConnector.showOverlay = false
|
||||
self.refresh.toggle()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -447,7 +461,7 @@ struct ContentView: View {
|
|||
)
|
||||
|
||||
|
||||
if paneConnector.showOverlay {
|
||||
if self.paneConnector.showOverlay {
|
||||
Rectangle()
|
||||
.frame(width: geometry.size.width - 50, height: geometry.size.height + 200)
|
||||
.background(.ultraThinMaterial)
|
||||
|
|
Loading…
Reference in New Issue