16 [UIButton systemButtonWithPrimaryAction:[UIAction actionWithHandler:^(
17 __kindof UIAction* _Nonnull action) {
18 UIActivityViewController* activityVC =
19 [[UIActivityViewController alloc] initWithActivityItems:@[ @"text to share" ]
20 applicationActivities:nil];
21 activityVC.excludedActivityTypes = @[
22 UIActivityTypePrint, UIActivityTypeCopyToPasteboard,
23 UIActivityTypeAssignToContact, UIActivityTypeSaveToCameraRoll
25 [
self presentViewController:activityVC animated:YES completion:nil];
27 openShare.backgroundColor = [UIColor systemPinkColor];
28 [openShare setTitle:@"Open Share" forState:UIControlStateNormal];
29 [
self.view addSubview:openShare];
30 openShare.frame = CGRectMake(0, 0, 200, 200);