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

Different positions of where the pill would show (Top and Bottom) #11

Open
Awesomeplayer165 opened this issue Mar 1, 2022 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@Awesomeplayer165
Copy link
Owner

Right now, the pill reveals through the top, but it would be cool if you could reveal from the bottom

@Awesomeplayer165
Copy link
Owner Author

Make sure it avoids the UITabBarController

@Awesomeplayer165 Awesomeplayer165 self-assigned this Mar 1, 2022
@Awesomeplayer165 Awesomeplayer165 added the enhancement New feature or request label Mar 1, 2022
@martindufort
Copy link
Contributor

martindufort commented Dec 14, 2023

I'm looking into adding this new structure:

import CoreGraphics

public struct PillAnimation {
    enum AnimationDirection {
        case fromTop
        case fromBottom
    }
    var direction: AnimationDirection
    var offsetFromEdge: CGFloat
}

This would also remove the need for the isNavigationControllerPresent variable which is really UIKit specific.
You would specify the proper offsetFromEdge to position it correctly.

This is needed so the stop position is dynamically calculated and would allow different stop position when animating from the top or the bottom.

@Awesomeplayer165
Copy link
Owner Author

Awesomeplayer165 commented Dec 15, 2023

I am open to relieving the dependency on UIKit specific or phone specific APIs. My original idea was to avoid offsetFromEdge, but with the addition of AppKit on macOS, it seems reasonable. Is there a time you need these changes by? I can try to work on it a little over the weekend, but PRs are much appreciated!

@martindufort
Copy link
Contributor

martindufort commented Dec 15, 2023

Well, we don't have to remove it.
We can always wrap the iOS specific calls and variables inside a #if os(iOS) section.

I will be working on adding this today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants