Last active
April 9, 2022 09:02
-
-
Save sorin-ref/56cb3d51b44097a53b738576c6086999 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
@main | |
struct MyApp: App { | |
var body: some Scene { | |
WindowGroup { | |
ContentView() | |
.statusBar(hidden: ProcessInfo.processInfo.isiOSAppOnMac) | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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