
- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to hide the status bar in a iOS App using Swift?
Sometimes in our application, we need to hide the status bar, navigation bar, and other things and only show the content we want to display. In this article, we’ll see how to hide the status bar in our application. To hide status bar in our iOS application using swift language we need to go through very basic steps.
We can hide the status bar in two general ways. Both of these methods involve a common step.
Common Step
- Go to Your info.plist file.
- Add a key called “View controller-based status bar appearance” and set its value to NO.
This was a common step we’ll use in both the methods mentioned below, which include one more step.
Method 1
In your info.plist file itself, add another key called “Status bar is initially hidden” and set it to YES.
Method 2
- Go to your app delegate file.
- Inside the method app did finish launching add a line of code.
UIApplication.shared.isStatusBarHidden = true
This will hide the status bar throughout the application.
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. // UIApplication.shared.isStatusBarHidden = true return true }
Both the above methods produce the same result which is,
- Related Questions & Answers
- How to hide status bar in Android using Kotlin?
- How to hide status bar in Android?
- How to create a WebView in an iOS App using Swift?
- Adding Navigation Bar programmatically iOS using Swift
- How to check notifications status for the iOS App
- How to create a Custom Dialog box on iOS App using Swift?
- How to create transparent Status Bar and Navigation Bar in iOS?
- How to make an HTTP request on iOS App using Swift?
- How to integrate a facebook login in swift for iOS App?
- How do you hide the onscreen keyboard in iOS App?
- How to load and display an image on iOS App using Swift?
- How to make an HTTP POST request on iOS App using Swift?
- How to change status bar color to match app Android using Kotlin?
- How to change status bar color to match app Android?
- How to display an image with rounded corners on iOS App using Swift?
Advertisements