DEV Community

Pheak Pheasa
Pheak Pheasa

Posted on

Easy way to make swift project to using only light mode.

func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). guard let _ = (scene as? UIWindowScene) else { return } window?.overrideUserInterfaceStyle = .light } 
Enter fullscreen mode Exit fullscreen mode
  • add only window?.overrideUserInterfaceStyle = .light into function scene in SceneDelegate.

  • select Product -> Clean Buil Folder

  • Now Just run you project again.

Top comments (0)