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

Is there a better way to structure post methods in Class Based Views -

reflection - How to access the object-members of an object declaration in kotlin -

php - Doctrine Query Builder Error on Join: [Syntax Error] line 0, col 87: Error: Expected Literal, got 'JOIN' -