I am trying to either default an ios app to a particular brightness when its opened. Is this possible? If so what packages do I need to use?
If this is not possible can I have a brightness scroll bar within the app itself?
Thank you!
I am trying to either default an ios app to a particular brightness when its opened. Is this possible? If so what packages do I need to use?
If this is not possible can I have a brightness scroll bar within the app itself?
Thank you!
To set screen brightness, Try this code
UIScreen.main.brightness = CGFloat(0.5)
You can check this article.
import UIKit
extension UIScreen
{
static func setMainBrightness(brightness: CGFloat)
{
guard (0...1).contains(brightness) else
{
print("Attempt to set the screen brightness to an invalid value: \(brightness) should be between 0 and 1 inclusive.")
return
}
self.main.brightness = brightness
}
}