Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save sorin-ref/56cb3d51b44097a53b738576c6086999 to your computer and use it in GitHub Desktop.
Save sorin-ref/56cb3d51b44097a53b738576c6086999 to your computer and use it in GitHub Desktop.
import SwiftUI
@main
struct MyApp: App {
var body: some Scene {
WindowGroup {
ContentView()
.statusBar(hidden: ProcessInfo.processInfo.isiOSAppOnMac)
}
}
}
class MyViewController {
// ...
override var prefersStatusBarHidden: Bool {
if super.prefersStatusBarHidden { return true }
if #available(iOS 14.0, *) {
return ProcessInfo.processInfo.isiOSAppOnMac
}
return false
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment