antoniocasero / Panels

Panels is a framework to easily add sliding panels to your application
MIT License
1.5k stars 89 forks source link

How to apply "modalPresentationStyle = .popover"? #21

Closed yeonpark333 closed 4 years ago

yeonpark333 commented 4 years ago

Hi, I want to make the background screen dark like modalpresentationstype = .popover. How can i do it?

antoniocasero commented 4 years ago

Hi @yeonpark333 , sorry, but the dark background is not implemented.

hytaoist commented 4 years ago

Hi, I want to make the background screen dark like modalpresentationstype = .popover. How can i do it?

you can add a BackgroundView in Panels's ParentViewController before it show. If you do like this, you should remove the BackgroundView when you dismiss Panels. I do like this, it work fine.

// show addBackground(backgroundColor: UIColor.colorWithHex(hex: "000000", alpha: 0.6)) panelManager.show(panel: panelVC, config: config, view: nil)

// dismiss panel?.dismiss() DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 0.4) { viewer.removeBackground() }