Can we change the value of info.plist key programmatically in ios?
like I want to change the value of 'View controller-based status bar appearance' key to 'YES' / 'NO' in different places.
Asked
Active
Viewed 4,109 times
3

Cœur
- 37,241
- 25
- 195
- 267

Dhaval H. Nena
- 3,992
- 1
- 37
- 50
1 Answers
1
You can't change values in the info.plist programmatically.
What you can do:
- Set "ViewControllerBased status bar appearance" to Yes
- Make a superclass for all your viewcontrollers (For example: "BaseViewController")
Override method
(UIStatusBarStyle)preferredStatusBarStyle
Set your default style there
- Override this method in any other subclass where want you to differ from that style

Thomas Keuleers
- 6,075
- 2
- 32
- 35
-
thanks.. but I know about this solution.. doing that will lead me to make changes in all the files.. which i don't want to do that's why looking for another options.. – Dhaval H. Nena Oct 22 '13 at 06:05
-
solved? please tell solution. thank you – Evgeny Fedin Jun 26 '17 at 11:09