forked from scenee/FloatingPanel
-
Notifications
You must be signed in to change notification settings - Fork 2
Update to v3.2.1 #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This PR modifies the transitionDuration(using:) method in FloatingPanelController to return 0.0 instead of calling fatalError when the FloatingPanelController instance is not found. This change is crucial for several reasons: 1. Avoiding Crashes in Production: Using fatalError in production can lead to unexpected crashes, which are detrimental to user experience. It's safer to return a default value like 0.0 and handle the scenario gracefully. 2. Improved Stability: By returning 0.0, the application can continue running, allowing for better stability and user satisfaction. This approach also aligns with the principle of fail-safety, where the system continues operating under error conditions. 3. Real-World Case: In our large-scale project, we encountered a crash at this specific point due to the fatalError. Given the size and complexity of our application, it has been challenging to pinpoint the exact cause. Switching to a return value of 0.0 would significantly help us mitigate the issue and maintain app stability while we investigate further. 4. Maintainability: Returning a default value makes the codebase more maintainable and easier to debug, as it avoids abrupt termination and allows for logging or other error handling mechanisms.
* Fix doc comment errors in ObjC APIs * Improve doc comments in LayoutAnchoring.swift
…ost expanded state (scenee#652) I decided to disallow interrupting panel interactions while bouncing over the most expanded state in order to fix the 2nd issue in scenee#633, scenee#633 (comment).
…ee#659) * Stop pinning the scroll offset in moving programmatically * Add 'optional' string interpolation * Add comments * Add CoreTests.test_initial_scroll_offset_reset() * ci: remove macos-12 jobs for the deprecation * ci: name circleci jobs
* Added '--verbose' in cocoapods job * Fixed 'error: No simulator runtime version'. Some of the example apps cannot be built on github actions. > /Users/runner/work/FloatingPanel/FloatingPanel/Examples/Samples/Sources/Assets.xcassets: error: No simulator runtime version from [<DVTBuildVersion 21A342>, <DVTBuildVersion 21C62>, <DVTBuildVersion 21E213>, <DVTBuildVersion 21F79>, <DVTBuildVersion 22B81>] available to use with iphonesimulator SDK version <DVTBuildVersion 22C146> * Used macos-15 to fix random build fails
…er the most expanded state (scenee#652)" This reverts commit b0fd0d4. This change had a problem normal cases. For example, in Maps example a panel interaction jumps occurs because of this.
This change addresses the 2nd issue reported in scenee#633. The previous attempt in commit b0fd0d4 was intended to fix this, but it has a regression. This change resolves the issue without introducing any regressions.
See this comment for more details. scenee#661 (comment)
The following errors occur only on Xcode 13.4.1. Addressing them would
significantly impair the usability of this library’s API. Therefore, I have
decided not to support Xcode 13.4.1.
> /.../FloatingPanel/Sources/SwiftUI/FloatingPanelView.swift:9:33: error: protocol 'FloatingPanelCoordinator' can only be used as a generic constraint because it has Self or associated type requirements
> let coordinator: () -> (any FloatingPanelCoordinator)
> ^
> /.../FloatingPanel/Sources/SwiftUI/FloatingPanelView.swift:78:42: error: protocol 'FloatingPanelCoordinator' can only be used as a generic constraint because it has Self or associated type requirements
> public func makeCoordinator() -> any FloatingPanelCoordinator {
> ^
> /.../FloatingPanel/Sources/SwiftUI/View+floatingPanel.swift:26:67: error: 'some' types are only implemented for the declared type of properties and subscripts and the return type of functions
> @ViewBuilder _ content: @escaping (FloatingPanelProxy) -> some View
> ^
> /.../FloatingPanel/Sources/SwiftUI/View+floatingPanel.swift:26:9: error: result builder attribute 'ViewBuilder' can only be applied to a parameter of function type
> @ViewBuilder _ content: @escaping (FloatingPanelProxy) -> some View
> ^
> /.../FloatingPanel/Sources/SwiftUI/View+floatingPanel.swift:24:31: error: default argument value of type 'FloatingPanelDefaultCoordinator.Type' cannot be converted to type 'T.Type'
> coordinator: T.Type = FloatingPanelDefaultCoordinator.self,
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> as! T.Type
> /.../FloatingPanel/Sources/SwiftUI/View+floatingPanel.swift:28:9: error: generic parameter 'ContentView' could not be inferred
> FloatingPanelView(
> ^
> /.../FloatingPanel/Sources/SwiftUI/FloatingPanelView.swift:8:49: note: 'ContentView' declared as parameter to type 'FloatingPanelView'
> public struct FloatingPanelView<MainView: View, ContentView: View>: UIViewControllerRepresentable {
> ^
> /.../FloatingPanel/Sources/SwiftUI/View+floatingPanel.swift:28:9: note: explicitly specify the generic arguments to fix this issue
> FloatingPanelView(
> ^
> <Self, <#ContentView: View#>>
* Added SamplesSwiftUI * Moved Maps-SwiftUI project in workspace * Updated build tools * Fixed xcode 15.1 build * Added FloatingPanel.SurfaceAppearance.box()
* Added 'FloatingPanel SwiftUI API Guide' * Updated README
Since iOS 26, UIGestureRecognizer.state is not able to change even if it's assigned a new value programmatically. Therefore, I created MockPanGestureRecognizer to change the state property in testing.
Fix some build and test issues on iOS 26
I set the minimum support version to v12.0 because this library can be built on iOS 12 as well using compilation conditions.
Store content hosting controller reference and update it dynamically in updateUIViewController(), allowing panel content to change without recreation. Resolved scenee#672
Support dynamic content updates in SwiftUI
…e#677) When the panel is already at a boundary position, floating-point precision errors on some devices (like iPhone 17 Pro Max) can cause unexpected offset resets in the position calculation. This commit addresses the layout issue where fractional values caused incorrect position evaluation. Based on the initial fix and sample project provided by @0x1306a94. Co-authored-by: 0x1306a94 <onyxes_accent_0a@icloud.com>
When we enable floatingPanelScrollTracking on our view inside of the floating panel, some view updates are performed (i.e., SwiftUI views are being instantiated) but no rendering (i.e., body evaluations) occurs.
Example code:
```swift
content
.floatingPanel(
coordinator: ContentPanelCoordinator.self,
onEvent: onEvent
) { proxy in
panelContent
.floatingPanelScrollTracking(proxy: proxy) // scroll tracking breaks view updates
}
```
We tracked this down to the scroll tracking, and it seems that the performing of view updates inside of the ScrollViewRepresentable was missing.
This seems similar to scenee#675.
# Conflicts: # .circleci/config.yml # .github/workflows/ci.yml # FloatingPanel.podspec # README.md # Sources/Info.plist # Tests/CoreTests.swift
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Rebased the 3.2.1 release from upstream into master.