UIActivityViewController 기초설명
UIActivityViewController 를 이용 text, image를 다른 앱에 share할수 있게 한다.
seen from Russia
seen from Colombia

seen from China
seen from Hong Kong SAR China
seen from Canada
seen from United States

seen from Germany
seen from Japan

seen from Indonesia
seen from Germany
seen from United States
seen from Germany

seen from Philippines

seen from Germany
seen from Germany

seen from Brazil
seen from China

seen from Germany
seen from China

seen from United Kingdom
UIActivityViewController 기초설명
UIActivityViewController 를 이용 text, image를 다른 앱에 share할수 있게 한다.

Anya is live and ready to show you everything. Watch her strip, dance, and perform exclusive shows just for you. Interact in real-time and make your fantasies come true.
Free to watch • No registration required • HD streaming
Dark Cocoa: How to display an iOS share sheet with AirDrop as the only option
Last week I was working on a feature for a new app which involves sharing some data between two devices (encoded in a URL to link into the app on the receiver’s device) — with the catch being that the transfer has to happen over AirDrop (trust me, there’s a good reason for it). I eventually got an AirDrop-only share sheet working, but I thought it’d be fun (and hopefully interesting) to dig into the process I went through in figuring it out.
Now since Apple doesn’t provide a way to access AirDrop directly, I had to go through UIActivityViewController. My first thought was to use its excludedActivityTypes property and just load up an array with every activity type listed in UIActivity.h (other than AirDrop). That works great… except when you come to iOS 8’s third-party app extensions.
My next idea was to just put together a list of some of the more popular share extension identifiers and add those to the excludedActivityTypes array. This wouldn’t have been a great solution, as there would always be extensions slipping through (and it wouldn’t have worked at all, as it turns out). Though this line of thought did lead me to what I thought was a very clever idea…
I suspected (and a quick trip to the debugger verified that I was right) that UIActivityViewController was just checking each extension identifier against the excludedActivityTypes array — so what if I passed its setter a trick NSArray subclass which would have a containsObject: method that returned NO to any object other than UIActivityTypeAirDrop? This worked like a charm for hiding all of the system-provided sharing options, but despite the fact that the array was checked for each third-party share extension’s identifier, the results of that check were ignored. I was disappointed that I’d have to scrap what I thought was a clever and elegant solution.
Okay, so it was time to go deeper. I took a look at some iOS 8 runtime headers, subclassed UIActivityViewController, and started to play around with some private instance variables in the debugger… and _activityGroupListViewController proved to be the winner.
Its two arrays, _activityGroupViewControllers and _visibleActivityGroupViewControllers, when run on an AirDrop-capable device, contained an object of an interesting sounding class: SFAirDropActivityViewController. By removing any other view controllers from those arrays (and hiding their views) I was left with an AirDrop-exclusive share sheet. All that was left to do was alter that UIActivityGroupListViewController’s preferredContentSize and disable scrolling on its collection view and — ✨ta-da! ✨— a pretty straightforward way to AirDrop something.
I’ve shared my complete solution on GitHub, but remember: these sorts of tricks should really be a last resort, and could potentially break with any system update — use them at your own risk.
Add a Sharing Option to your App
This article will guide you about how to add a sharing option to your application.
For example the code below will share an integer value which is included in an NSString. Furthermore it´s important that you can share multiple objects through the array.
Sample Code:
NSString *string; string = [NSString stringWithFormat:@"Shared Integer", myinteger]; NSArray *objectsToShare = @[string]; UIActivityViewController *controller = [[UIActivityViewController alloc] initWithActivityItems:objectsToShare applicationActivities:nil]; [self presentViewController:controller animated:YES completion:nil];
Given the ever-burgeoning iOS app ecosystem, it makes sense to provide some sort of data interactivity with other applications in your own app, for the users' benefit.
This post looks at some of the options available for sharing data between apps, including UIDocumentInteractionController, UIActivityViewController, Pasteboards, and URL schemes.
# [DMActivityInstagram](http://github.com/coryalder/DMActivityInstagram) A UIActivity class for sharing images to Instagram. iOS 6 introduced the new UIActivityViewController, which presents sharing options like Facebook and Twitter (as well as printing and copying). I wanted to adapt this for [CatPaint](http://catpaint.info), which currently uses [ShareKit](http://github.com/ShareKit/ShareKit) for sharing. My current Instagram sharer stopped working in iOS 6, and I figured now would be a good time to implement Instagram sharing using this new technique. Usage is simple: DMActivityInstagram *instagramActivity = [[DMActivityInstagram alloc] init]; NSArray *activityItems = @[self.imageView.image, @"CatPaint #catpaint", [NSURL URLWithString:@"http://catpaint.info"]]; UIActivityViewController *activityController = [[UIActivityViewController alloc] initWithActivityItems:activityItems applicationActivities:@[instagramActivity]]; [self presentViewController:activityController animated:YES completion:^{}]; Hopefully this code will be helpful for other people implementing their own UIActivity sharers, and getting Instagram support in to their apps. I would love if someone took an axe to the visual design of the resizer view. It's not my best work (especially on iPad it looks funny). The resizer view is only needed if your app creates non-square images. This is not in use in a shipping app yet, but it will be soon.

Anya is live and ready to show you everything. Watch her strip, dance, and perform exclusive shows just for you. Interact in real-time and make your fantasies come true.
Free to watch • No registration required • HD streaming