
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
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
Hide Status Bar in 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,
Advertisements