iDevelopper / PBPopupController

A framework for presenting bars and view controllers as popup, much like the look and feel of Apple Music App.
MIT License
62 stars 15 forks source link

Background PopupContentViewController in Dark Mode #28

Closed balabon7 closed 1 year ago

balabon7 commented 1 year ago

Hello 👋

When I switch the device in a Dark Mode, the PopupContentViewController background is automatically darkened.

Please tell me where in the library code you can change the darkening level or remove the dimming?

(At least in debugging mode)

IMG_9707 IMG_9708

iDevelopper commented 1 year ago

Hello,

You can have a look at the overrideUserInterfaceStyle property (not used in the example project) if you want to force the view or all views (window) to always adopt a light or dark interface style.

Otherwise, since iOS 13 the UI Element Colors objects adapt automatically to Dark Mode changes when you use the provided UIColor object (https://developer.apple.com/documentation/uikit/uicolor/ui_element_colors).

In the example, in PopupContentViewController.swift, you can see:

        if #available(iOS 13.0, *) {
            self.view.backgroundColor = UIColor.secondarySystemBackground
        }

This color automatically changes when the dark mode changes.

You can change the UI Element Color Object (secondarySystemBackground) by the standard color of your choice (https://developer.apple.com/documentation/uikit/uicolor/standard_colors).

balabon7 commented 1 year ago

Thank you very much for your help, dismantled with a color change 👍