Skip to content
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

iPad Bottom Sheet, but at the Bottom ✨ #100

Merged
merged 8 commits into from Sep 9, 2022
Merged

iPad Bottom Sheet, but at the Bottom ✨ #100

merged 8 commits into from Sep 9, 2022

Conversation

ghost
Copy link

@ghost ghost commented Sep 6, 2022

Hi!

I like this library, but it would be awesome if the bottom sheet could actually be at the bottom on an iPad. 😁

So... that's where this PR is for! I've also added a modifier that enables you to override the sheet width, and a modifier that adds bottom padding to the main content if the keyboard is opened (which should fix this issue I believe: #97 ).


iPad Demo

View's Code

VStack {
    Button("TESTING APP πŸ¦†") {}
}
.bottomSheet(
    bottomSheetPosition: $position,
    switchablePositions: [.dynamicBottom, .absolute(400), .absolute(600), .relativeTop(1)],
    headerContent: { Text("Bottom Sheet Title").font(.title.bold()) },
    mainContent: {
        VStack {
            Divider().padding()
            TextEditor(text: $loremIpsum)
        }
    }
)
.iPadFloatingSheet(false)
.relativeSheetWidth(1.0)
.accountForKeyboardHeight()

Without the keyboard auto adjust

before.mp4

With the keyboard auto adjust

after.mp4

I'm looking forward to your feedback! 😊

@lucaszischka
Copy link
Owner

Amazing pull request. First of all, thank you for your work! I will review it later today.

@lucaszischka lucaszischka added enhancement New feature or request Thank You ❀️ For people who appreciate my work labels Sep 6, 2022
@ghost
Copy link
Author

ghost commented Sep 6, 2022

Ah, I see the issue that turned up in the CI, I'm currently fixing it!

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@lucaszischka
Copy link
Owner

Amazing pull request. Mentioned a couple of thinks (most if it really small changes to so that you match my code style). πŸ₯³ Thank you for your clean contribution ❀️

@lucaszischka lucaszischka linked an issue Sep 6, 2022 that may be closed by this pull request
@lucaszischka
Copy link
Owner

Oh and before I forget to mention it. Please also add your changes to the changelog and update the version in the podspec file accordingly.

Also if you have any questions regarding my review please ask.

@ghost ghost requested a review from lucaszischka September 7, 2022 14:19
Copy link
Owner

@lucaszischka lucaszischka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good; I mentioned a couple of things that I would like to be changed. However if you want i can merge it now and change the rest myself. You’ve already been a big help.

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
Sources/BottomSheet/Models/BottomSheetWidth.swift Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@lucaszischka lucaszischka merged commit 18b6164 into lucaszischka:main Sep 9, 2022
@ghost ghost deleted the ipad-bottom-sheet branch September 9, 2022 12:21
@ghost
Copy link
Author

ghost commented Sep 9, 2022

Thanks for merging! 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Thank You ❀️ For people who appreciate my work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ignored keyboard safe area on iPhone.
2 participants