title: Launching black screen appear : Mac OS app
body: <p>I want to launch my mac app in full screen and hide the <code>menu</code> and <code>doc</code> so the user can not switch the app or can see another app. so I used the below code to launch windows in full screen.</p>
  <pre><code>override func viewDidAppear() {
        super.viewDidAppear()
              let presOptions: NSApplication.PresentationOptions = [.hideDock, .fullScreen]
  
              let optionsDictionary = [NSView.FullScreenModeOptionKey.fullScreenModeApplicationPresentationOptions :
                                          NSNumber(value: presOptions.rawValue)]
  
              self.view.enterFullScreenMode(NSScreen.main!, withOptions:optionsDictionary)
              self.view.wantsLayer = true
  
    }
  </code></pre>
  <p>but it shows a black screen when the app is launch see the image.<a href="https://i.stack.imgur.com/LvFbS.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LvFbS.png" alt="enter image description here" /></a></p>
  <p>So my question is what's the best way to open the mac os app in full screen with hiding <code>Doc</code> and <code>Menu</code></p>