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

Incorrect macOS version #3

Open
NikcN22 opened this issue Jul 10, 2023 · 0 comments
Open

Incorrect macOS version #3

NikcN22 opened this issue Jul 10, 2023 · 0 comments

Comments

@NikcN22
Copy link

NikcN22 commented Jul 10, 2023

'onChange(of:perform:)' is only available in macOS 11.0 or newer

File EasyMenu.swift

// MARK: Body
  public var body: some View {
      Button {
          withAnimation(.easeInOut(duration: config.animationDuration)) {
              showMenu.toggle()
          }
      } label: {
          label
      }
      .onAppear(perform: {
  #if os(macOS)
          if let screen = NSScreen.main {
              screenWidth = screen.frame.size.width
              screenHeight = screen.frame.size.height
          }
  #else
          screenWidth = UIScreen.main.bounds.size.width
          screenHeight = UIScreen.main.bounds.size.height * 2
  #endif
      })
      .overlay(backgroundOverlay())
      .overlay(menuOverlay())
      .onChange(of: isActive) { newValue in    //// <<--- ERROR
          withAnimation(.easeInOut(duration: config.animationDuration)) {
              showMenu.toggle()
          }
      }
//        .zIndex(Double.infinity)
  }
@NikcN22 NikcN22 changed the title Incorrect macOs version Incorrect macOS version Jul 10, 2023
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

1 participant