ios - Warning when presenting UIActivityViewController -


when present uiactivitycontroller using code below get, presented console shows "warning: attempt present <uiactivityviewcontroller: 0x7f8788e7aed0> on <myapp.customtableviewcontroller: 0x7f8788e3db60> presenting (null)".

@ibaction func shareimage(sender: anyobject) {     let images: [uiimage] = [image.image!]     let activityviewcontroller = uiactivityviewcontroller(activityitems: images, applicationactivities: nil)     self.presentviewcontroller(activityviewcontroller, animated: true, completion: nil) } 

this func called uilongpressgesturerecognizer. note i'm using storyboard following hierarchy:

tabbarcontroller > (relationship) > navigationcontroller > (relationship) > tableviewcontroller > (show) > tableviewcontroller > (show) > viewcontroller.

the presentation happens on last viewcontroller.

i'm quite sure it's hierarchy, controller presenting (and maybe how) , controller responsible presenting uiactivityviewcontroller.

edit

uilongpressgesturerecognizer touch event called multiple times causing warning

it's hard question there other view controller presented @ moment happens? example , action sheet or other?

in case try this:

    if self.presentedviewcontroller != nil {         self.dismissviewcontrolleranimated(false, completion: {             [unowned self] in             self.presentviewcontroller(activityviewcontroller, animated: true, completion: nil)             })     }else{         self.presentviewcontroller(activityviewcontroller, animated: true, completion: nil)     } 

Comments

Popular posts from this blog

How to connect android app to App engine -

gcc - MinGW's ld cannot perform PE operations on non PE output file -

php - display validation error message next to the textbox in codeigniter -