LoginSignup
3
1

More than 5 years have passed since last update.

swift4でアプリの画面の明るさを変更させる✨

Posted at

:star::star:備忘録もかねて:star::star:

brightness.swift
import UIKit

// 0.0〜1.0で設定する
UIScreen.main.brightness = 1.0

0.0で真っ暗で、1.0で眩しくなります:sunglasses:
CGFloat型で設定してあげましょう。

import UIKitを入れ忘れて動かないな〜と、少し時間を潰してしまったのが残念:joy:

3
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
1