Change the value of Info.plist key programmatically in ios [duplicate]
Asked Answered
C

1

3

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.

Correy answered 22/10, 2013 at 5:31 Comment(0)
F
1

You can't change values in the info.plist programmatically.

What you can do:

  1. Set "ViewControllerBased status bar appearance" to Yes
  2. Make a superclass for all your viewcontrollers (For example: "BaseViewController")
  3. Override method

    (UIStatusBarStyle)preferredStatusBarStyle

  4. Set your default style there

  5. Override this method in any other subclass where want you to differ from that style
Forensics answered 22/10, 2013 at 5:43 Comment(2)
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..Correy
solved? please tell solution. thank youOnstage

© 2022 - 2024 — McMap. All rights reserved.