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

Disable .hidden position after the initial launch #344

Closed
3 of 7 tasks
Isuru-Nanayakkara opened this issue Apr 25, 2020 · 4 comments
Closed
3 of 7 tasks

Disable .hidden position after the initial launch #344

Isuru-Nanayakkara opened this issue Apr 25, 2020 · 4 comments

Comments

@Isuru-Nanayakkara
Copy link

Description

Initially the floating panel is hidden. When a button is tapped, it comes into the half position. Then user can go back and forth between full and half by swiping. But since initially hidden was also added as a supported position, if I swipe down while the panel is in the half position, it slides down and goes into the hidden position.

Expected behavior

I want to have the panel hidden initially but after showing it, I want to keep it between half and full positions.

Steps to reproduce

class CumtomFloatingPanelLayout: FloatingPanelLayout {
    var initialPosition: FloatingPanelPosition {
        return .hidden
    }
    
    var supportedPositions: Set<FloatingPanelPosition> {
        return [.hidden, .half, .full]
    }
    
    func insetFor(position: FloatingPanelPosition) -> CGFloat? {
        switch position {
            case .full: return 200
            case .half: return 240
            case .hidden, .tip: return nil
        }
    }
}

How do you display panel(s)?

  • Add as child view controllers
  • Present modally

How many panels do you displays?

  • 1
  • 2+

Environment

Library version
1.7.4

Installation method

  • CocoaPods
  • Carthage
  • Swift Package Manager

iOS version(s)
13.4

Xcode version
11.4.1

@scenee
Copy link
Owner

scenee commented Apr 29, 2020

I understood your use case. I will consider how to deal with it in the library.

@scenee
Copy link
Owner

scenee commented Apr 29, 2020

@Isuru-Nanayakkara I created #345 PR to support your use case. Could you try it?

@Isuru-Nanayakkara
Copy link
Author

Thanks for the quick fix. I tried it and it seems to work great! 👍🏼

@scenee
Copy link
Owner

scenee commented Apr 29, 2020

Thanks for your confirmation! It will be released in v1.7.5.

@scenee scenee closed this as completed Apr 29, 2020
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