Skip to content

Commit

Permalink
Fix laggy page swiping
Browse files Browse the repository at this point in the history
Finally! And It ended up being so easy once I knew what to do.
You'll notice when rotating the device that it's still laggy to update, however, which I think is an indication that my views aren't very efficient and are expensive to reload.
  • Loading branch information
skjiisa committed Nov 4, 2021
1 parent f8d4261 commit f7711aa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Tickmate/Tickmate/Supplementary Views/PageView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ struct PageView<Content: View>: View {
}
.frame(width: geo.size.width, alignment: .leading)
.offset(x: -CGFloat(currentIndex) * geo.size.width + translation)
.animation(dragging ? .none : .push)
.animation(dragging ? .easeOut(duration: 0.05) : .push)
.gesture(
DragGesture().updating($translation) { value, state, _ in
dragging = true
Expand Down

1 comment on commit f7711aa

@skjiisa
Copy link
Owner Author

@skjiisa skjiisa commented on f7711aa Nov 4, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Closes #63

Please sign in to comment.