andreamazz / andreamazz/AMScrollingNavbar

ScrollView sometimes doesn't get back to it's default position.

Open
#311 10 comments 2 reactions 0 assignees View on GitHub
awaiting feedback
Dominant language
Swift
Stars
6k
Forks
628
PR merge metrics
No merged PRs in 30d

Description

Hello.

Am am using this framework with `WKWebView` to minimize `Navigation Bar` when scrolling downwards. I am facing a problem when `Navigation Bar` has its full height, but my web view is offset as if the bar has its small height.

[Here](https://youtu.be/IweFHCFsJKA) is the video, where everything works fine.
And [here](https://youtu.be/TdTl36lV9eU) is the video, where the behaviour is undesired.

To use the framework I've added the following lines into `View Controller` that manages `WKWebView`:

override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
// My other code
// ...
guard let navigator = navigationController as? ScrollingNavigationController else { return }
navigator.followScrollView(webView.scrollView, delay: 55.0)
}
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
guard let navigator = navigationController as? ScrollingNavigationController else { return }
navigator.stopFollowingScrollView()
}

`webView` is a `UIView` that has `WKWebView` instance inside its view hierarchy, as well as some other views. It's `scrollView` property simply returns `WKWebView` instance's `scrollView` property.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.