ios - How to show alert view once in view controller in Swift 3? -


this question has answer here:

i creating app when user enters page, alert view pops saying "click on button proceed". how can make alert view show once in view controller? help.

override func viewdidappear(_ animated: bool) {     super.viewdidappear(animated)      let alertcontroller = uialertcontroller(title: "info", message: "click on button proceed", preferredstyle: uialertcontrollerstyle.alert)     let mybacksign = uialertaction(title: "ok", style: uialertactionstyle.default, handler: nil)     alertcontroller.addaction(mybacksign )     self.present(alertcontroller, animated: true, completion: nil) } 

viewwillappear , viewdidappear called every time view displayed.

if want call method invoked once viewdidload.

viewdidload called once when view loaded memory.

use viewdidload.


Comments

Popular posts from this blog

angular - DownloadURL return null in below code -

meteor - inserting data to database gives error "insert failed: Method '/texts/insert' not found" -