feat: add cross-platform BottomActionBar and TopActionBar components#455
Merged
MarcHidalgo5 merged 3 commits intodevelopfrom Feb 23, 2026
Merged
feat: add cross-platform BottomActionBar and TopActionBar components#455MarcHidalgo5 merged 3 commits intodevelopfrom
MarcHidalgo5 merged 3 commits intodevelopfrom
Conversation
Introduce cross-platform `bottomActionBar` and `topActionBar` extensions for SwiftUI View. These components allow you to easily add action bars at the top or bottom of a UI view, supporting both iOS and Android platforms with platform-specific implementations. For iOS, utilize SwiftUI's view modifiers to overlay buttons with safe area insets. For Android, employ Compose UI components to integrate the action bars at appropriate positions. Add previews for `Top Button` and `Bottom Button` configurations to demonstrate the usage of these new action bars in SwiftUI previews. This enhancement improves UI consistency and interoperability across platforms.
Rename `BottomActionBar.swift` to `ActionBar.swift` and move it from the `Extensions` directory to `ViewModifiers` to better reflect its purpose and usage. Remove duplicate code by unifying `bottomActionBar` and `topActionBar` implementations into a single flexible method `actionBarInset`. This change improves code maintainability and readability by eliminating redundant extensions and consolidating platform-specific logic.
Wrap the `actionBarInset` method with an `#if os(iOS) || os(macOS)` directive to ensure this private function is only included on iOS and macOS platforms. This change keeps the codebase platform-specific, making it maintainable and preventing unnecessary compilation on unsupported platforms like Android. It also aligns with the pattern used for the `AndroidActionBarScaffold`, improving consistency.
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
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.
✨ Add cross-platform
bottomActionBarandtopActionBarThis PR introduces cross-platform
bottomActionBarandtopActionBarextensions forSwiftUI.View.These components allow adding action bars at the top or bottom of a view in a clean and reusable way, with platform-specific implementations for iOS and Android.
🧩 Implementation Details
iOS
Android
🔍 Previews
Previews have been added for both Top Button and Bottom Button configurations to demonstrate usage in SwiftUI previews.
This enhancement improves UI consistency and cross-platform interoperability.
🚀 API Usage Examples
Bottom Action Bar
Top Action Bar
📱 Top Bar Comparison
📱 Bottom Bar Comparison