Problems adding custom activity to UIActivityController

前端 未结 3 1949
遥遥无期
遥遥无期 2020-12-10 06:23

I am trying to implement a custom activity to the standard activities (Print, Mail, FaceBook, etc.) but for now only want the standard Print (for AirPrint) and my own custom

3条回答
  •  庸人自扰
    2020-12-10 07:07

    @troop231 - great answer, and very helpful.

    The only thing I'd add is to be sure to signal completion of the operation or the completion routine won't get called and the popover won't dismiss. Something like:

    - (void)performActivity {
        NSLog(@"Do the actual activity here");
        // My custom code here
    
        [self activityDidFinish:YES];  // indicate completion here!!
    }
    

提交回复
热议问题