0

When apps goes background mode, I want to show a default image in capture screen. If user may try to kill the application with double press the home button which is show the list of application, there also need to show my static image.

Senthilkumar
  • 2,471
  • 4
  • 30
  • 50

1 Answers1

0

I tried with this process, If any thing wrong please correct me.

func applicationDidEnterBackground(_ application: UIApplication) {

        if((self.imgViewStaticImage) != nil)
        {
            self.imgViewStaticImage?.removeFromSuperview()
        }

        self.imgViewStaticImage = UIImageView(frame: (self.window?.bounds)!)
        self.imgViewStaticImage?.image = UIImage(named: "banner")
        self.window?.addSubview(self.imgViewStaticImage!)
    self.window?.bringSubview(toFront: self.imgViewStaticImage!)

    }

    func applicationWillEnterForeground(_ application: UIApplication) {

        if((self.imgViewStaticImage) != nil)
        {
            self.imgViewStaticImage?.removeFromSuperview()
        }

    }
Senthilkumar
  • 2,471
  • 4
  • 30
  • 50