Created
January 20, 2016 07:04
-
-
Save tranhieutt/f73999234339f31aa86c to your computer and use it in GitHub Desktop.
Lost items after sorting item in More menu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSURL *url = [self fileToURL:self.documentName]; | |
NSArray *objectsToShare = @[url]; | |
AirDropActivityView *activityDownload = [[AirDropActivityView alloc] init]; | |
activityDownload.airDropType = 0; | |
AirDropActivityView *activityTrash = [[AirDropActivityView alloc] init]; | |
activityTrash.airDropType = 1; | |
AirDropActivityView *activityMove = [[AirDropActivityView alloc] init]; | |
activityMove.airDropType = 2; | |
NSArray *uiActivitys = @[activityDownload,activityTrash,activityMove]; | |
UIActivityViewController *controller = [[UIActivityViewController alloc] initWithActivityItems:objectsToShare applicationActivities:uiActivitys]; | |
// Exclude all activities except AirDrop. | |
NSArray *excludedActivities = @[UIActivityTypePostToTwitter, UIActivityTypePostToFacebook, | |
UIActivityTypePostToWeibo, | |
UIActivityTypeMessage, UIActivityTypeMail, | |
UIActivityTypePrint, UIActivityTypeCopyToPasteboard, | |
UIActivityTypeAssignToContact, UIActivityTypeSaveToCameraRoll, | |
UIActivityTypeAddToReadingList, UIActivityTypePostToFlickr, | |
UIActivityTypePostToVimeo, UIActivityTypePostToTencentWeibo]; | |
controller.excludedActivityTypes = excludedActivities; | |
// Present the controller | |
[self presentViewController:controller animated:YES completion:nil]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have problem with UIActivity function
The first, I create 3 activity items: activityDownload,activityTrash,activityMove. And add to UIActivityViewController
And then, when I present UIActivityViewController which includes 3 items above. OK, no problem here.
Then, when I click button More, and sort items, ex, I move "Move" button to the top,
After click "Done" button, I don't know why Download, Trash items was lost?
Move items only display in AirDrop menu view