0

Is it possible to just detect (not change) current brightness level on iOS screen? For example, I am trying to set a certain brightness value at which the UI/styles may change based on the current context. Sort of like responsive stylesheet switching, but instead of using dimensions I want to change per brightness.

If you have heard of this on any mobile operating system, please let me know that as well. Thank you for your time!

I am asking this to propose a project to an engineer, thus my limited knowledge of the code. Just looking for a yes or not possibility. I need to understand the feasibility before I propose it and have not found information on this elsewhere.

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Danelle
  • 11
  • 3

1 Answers1

2

Just to clarify since you seem confused between getters and setters:

To read either:

float brightness = [[UIScreen mainScreen] brightness];

or

float brightness = [UIScreen mainScreen].brightness;

To change:

float brightness = XX;
[[UIScreen mainScreen] setBrightness:brightness];

or

float brightness = XX;
[UIScreen mainScreen].brightness = brightness;
Joel
  • 15,654
  • 5
  • 37
  • 60