Skip to content

Commit

Permalink
Removing dispatch
Browse files Browse the repository at this point in the history
  • Loading branch information
Fernando Moya de Rivas committed Mar 2, 2020
1 parent 64a2c31 commit fef8ba7
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions Sources/SwiftUIPager/Pager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -206,14 +206,12 @@ extension Pager {
}
newPage = max(0, min(self.numberOfPages - 1, newPage))

// workaround to solve issue introduces in Xcode 11.3 where for some reason State variables were updated before bindings
DispatchQueue.main.async {
withAnimation(.easeOut) {
self.pageIndex = newPage
self.draggingOffset = 0
self.draggingStartTime = nil
}
withAnimation(.easeOut) {
self.pageIndex = newPage
self.draggingOffset = 0
self.draggingStartTime = nil
}

}
)
}
Expand Down

0 comments on commit fef8ba7

Please sign in to comment.