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

Using DrawerSlideTransition should resize the side view controllers to the available width #18

Closed
dvkch opened this issue Mar 1, 2018 · 2 comments

Comments

@dvkch
Copy link

dvkch commented Mar 1, 2018

First off, really good work, it's a really clear project and easy to setup!

I have a suggestion: when using a DrawerSlideTransition, since no background is visible (like DrawerFloatTransition for instance), it would be great if the child view controllers were resized to fit the available width.

I have been able to make this by updating a bit DrawerContent.swift :

    internal func updateView() {
        let width = CGFloat(drawerWidth)
        contentView.frame.size.width = width
        drawerOffset = 0.0
        
        guard let superView = contentView.superview else { return }
        if drawerSide == .right {
            drawerOffset = superView.frame.width - width
        }
        viewController.view.frame = CGRect(
            x: 0,
            y: 0,
            width: width,
            height: superView.frame.height
        )
    }

This may not be perfect to obtain the needed behaviour, and this affects all other transitions. Would you know a way to achieve this behaviour with a custom transition or a an additional setting?

I also noticed it's not possible de create custom transitions because the methods of DrawerTransition are not marked open.

@kawoou
Copy link
Owner

kawoou commented Apr 17, 2018

Thank you for your good suggestion.

First, the proposed DrawerContent.swift file has been modified in #24.

Next, i will modify the part that is not open.
Thank you for letting know what I missed.

@kawoou
Copy link
Owner

kawoou commented Apr 17, 2018

@dvkch Fixed access levels issue #27.

@kawoou kawoou closed this as completed Apr 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants