Skip to content

[BUG] Not working while we define scenePhase #179

@jaykarparmar

Description

@jaykarparmar

Not working while we defining scenePhase in the App File.

Current Behavior

It shows the blank screen only.

Code Sample

`import SwiftUI
import MijickPopups

@main
struct PopupsDemoApp: App {

@UIApplicationDelegateAdaptor(AppDelegate.self) var appDelegate
@Environment(\.scenePhase) private var scenePhase
@StateObject private var appManager = AppManager()

var body: some Scene { WindowGroup {
    ContentView().registerPopups() { $0
        .center {
            $0.backgroundColor(.backgroundSecondary)
              .cornerRadius(20)
              .popupHorizontalPadding(20)
        }
        .vertical {
            $0.backgroundColor(.backgroundSecondary)
              .cornerRadius(20)
              .enableStacking(true)
              .tapOutsideToDismissPopup(true)
        }
    }
    .environmentObject(self.appManager)
}}

}

struct ContentView: View {

@EnvironmentObject private var appManager: AppManager

var body: some View {
    VStack {
        Button {                
            Task {
                await ToastView(description: "Description will be here").dismissAfter(2).present()
            }
        } label: {
            Text("Show Popup")
        }

    }
    .padding()
}

}`

Screenshots

Image

Context

Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.

Name Version
SDK e.g. 4.0.1
Xcode e.g. 16.3
Operating System e.g. iOS 18.4
Device e.g. iPhone 16

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions