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

Way to change the width of the drawer (iPad apple maps) #90

Open
bryan1anderson opened this issue Jan 29, 2019 · 11 comments
Open

Way to change the width of the drawer (iPad apple maps) #90

bryan1anderson opened this issue Jan 29, 2019 · 11 comments
Assignees
Labels

Comments

@bryan1anderson
Copy link

bryan1anderson commented Jan 29, 2019

We're dealing with a map related product and would like to mimic iOS maps.

DrawerKit satisfies our needs on an iPhone, but anything in the size class of iPads, the drawer is too big.

Is there a way to limit the size of the container view controller?

I'm looking in to DrawerGeometry but it doesn't look like I can get at it, or provide it to my presentation handler or anything

@bryan1anderson bryan1anderson changed the title Way to change the size of the drawer Way to change the width of the drawer (iPad apple maps) Jan 30, 2019
@gtsiap
Copy link
Contributor

gtsiap commented Jan 30, 2019

Unfortunately this is currently not supported.

@bryan1anderson
Copy link
Author

bryan1anderson commented Jan 30, 2019

I see. This makes having a drawer interface much less useful or iPad

@bryan1anderson
Copy link
Author

@gtsiap Do you have any ideas off the top of your head for the best way to implement this. I'd be happy to work on it in my time and do a pull request

@bryan1anderson
Copy link
Author

bryan1anderson commented Jan 31, 2019

    var containerViewSize: CGSize {
        let newSize = CGSize(width: containerViewBounds.size.width / 2, height: containerViewBounds.size.height)
        return newSize
    }

It was absolutely super simple by just changing the container view size.

@bryan1anderson
Copy link
Author

bryan1anderson commented Jan 31, 2019

What I propose is to add an optional property to the configuration that allows for a width override.
containerViewSize will decide to use width if is not nil

Why?
There is definitely a use case. Pulley, a major competing library, already implements it. Apple Maps implements it.

It doesn't add needless complication. It works almost right out of the box (as far as I can tell, not running UI tests)

@RuiAAPeres
Copy link

@bryan1anderson we are evaluating a re-design of this library for it to be flexible and as a side-effect handle your use-case.

@bryan1anderson
Copy link
Author

@RuiAAPeres Has this been looked at further?

@rafaelmaroxa
Copy link

@bryan1anderson did you come to a solution?

@bryan1anderson
Copy link
Author

@rafaelmaroxa I had to create my own solution sadly

@rafaelmaroxa
Copy link

@bryan1anderson Thanks! I'm leaning towards that too.

@bryan1anderson
Copy link
Author

I want this to be officially made a feature request. I would consider scrapping everything I've done if I could guarantee this library would handle it

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

No branches or pull requests

4 participants