The Logging API document says that `os_log` is one of the legacy logging
symbols. However, this library needs to be supported below iOS 14 so
`log(level:_:)` cannot be used.
This was noticed when updating contained SwiftUI views rapidly.
This change is what fixed a certain bug the scroll content can be locked at a negative offset. It was most obvious when the whitespace was large, hence the offset was something around -100.0. At the same time, the contents (like buttons) were non-interactive.
Co-authored-by: Sören Gade <soeren.gade@lichtblick.de>
`dismissalTapGestureRecognizer` didn't work when the panel is added into UIWindow directly as its subview. This PR fixes this issue and also adds the use case in Samples.app.
This is the revised version of commit 448fc5c.
Commit 448fc5c has a critical regression in scroll tracking that can cause the
scroll content to bounce after moving a panel, for example, pulling down it from
full to half state.
By re-investigating #524, I found that this problem only occurred with the
`fitToBounds` content mode and a small scroll view content.
Therefore I fixed it in the more specific way.
UIScrollView would unexpectedly change its scroll offset after updating the bounces property when dealing with small scrollable content. This fixes issue #524, "Scrolling jumps when tableView content is small".
This commit sets the initial scroll offset to the pinning offset.
The previous implementation, which set it to the current content offset,
leads various scroll tracking bugs. This reproduction is one of issues.
Using 'Scroll tracking(UITableView)' in Samples app.
1. Bounce the scroll content at the top most anchor.
2. Pull down the panel in bouncing at a minus content offset. (the
scroll content stops at the minus offset.)
3. Pull up it
The previous implementation was implemented for #526/#527. But now the
issue hasn't been reproduced in v2.5.6.
This fixes#572 to change the backdrop alpha when the view size or
its size class changes.
The main change is that `true` is passed as a
`forceLayout` parameter into `viewWillTransition(to:with:)` callbacks.
Because it's necessary for the backdrop alpha's update when the view
size or its size class changes.
This also fixes a regression at `9c45c31` commit.
```diff
- layoutAdapter.activateLayout(for: state, forceLayout: true)
+ layoutAdapter.activateLayout(for: state, forceLayout: forceLayout)
```
The behavior before the above change indicates that the method has
worked well even when `forceLayout` is set to `true` in their callbacks.
Additional improvements:
* Format `activateLayout(forceLayout:contentInsetAdjustmentBehavior:)`
* Add `_floor` function for `test_updateBackdropAlpha()`
This resolves issue #561. Instead of continuing to work a modal presentation transition even if a panel state is not .hidden, this library calls fatalError as a programmer error on the occasion.
With Xcode 14 Beta 1 library fails to compile with following error.
> Stored properties cannot be marked potentially unavailable with `@available`
Because CALayerCornerCurve is not marked with any @available annotation it is possible to declare private optional storage of it.
They were set to `.required - 1` is #359, which fixed#294. However #294
was an issue on `.fitToBounds` content mode. But because of #444 and #515,
if your panel’s content mode is `.static`, their priorities should be set to
`.required` on `.static` content mode.
* Fix FloatingPanelController.invalidateLayout() implementation as following the doc comment
* Revise the doc comments of invalidateLayout() method, layout and behavior properties of FloatingPanelController.
* Add a note in README
* Fix some grammar errors
The backdrop alpha of a panel must be updated only in `Controller.show(animated:completion:)`.
Because that prevents a backdrop flicking just before presenting a panel.
Resolve#466.