ios - AlertController appears twice when saving video -


here code:

            let library = alassetslibrary()              library.writevideoatpathtosavedphotosalbum(nsurl(string: path), completionblock: { (url, error) -> void in                 if error != nil {                     let error = uialertcontroller(title: "error!", message:                         "your video not saved!", preferredstyle: uialertcontrollerstyle.alert)                     error.addaction(uialertaction(title: "shit!", style: uialertactionstyle.default,handler:                         { action in navigationcontroller!.popviewcontrolleranimated(true) }))                     self.presentviewcontroller(error, animated: true, completion: nil)                 } else {                     let alertcontroller = uialertcontroller(title: "done!", message:                         "your video saved!", preferredstyle: uialertcontrollerstyle.alert)                     alertcontroller.addaction(uialertaction(title: "nice!", style: uialertactionstyle.default,handler:                         { action in navigationcontroller!.popviewcontrolleranimated(true) }))                     self.presentviewcontroller(alertcontroller, animated: true, completion: nil)                 }             }) 

and alertcontroller says video saved appears twice if press "ok" fast (if wait few seconds fine). what's problem , how can solve ?


Comments

Popular posts from this blog

qt - Using float or double for own QML classes -

Create Outlook appointment via C# .Net -

ios - Swift Array Resetting Itself -