If a title is too long, the system wraps it and may truncate it. Write a succinct, descriptive title for each custom action you provide. If you need to create a custom interface icon, center it in an area measuring about 70x70 pixels.
SF Symbols provides a comprehensive set of configurable symbols you can use to communicate items and concepts in an activity view. For example, if you enable custom formatting to print a bank transaction, use a title that helps people understand what your print activity does, like “Print Transaction.”Ĭonsider using a symbol to represent your custom activity. If you need to provide app-specific functionality that’s similar to an existing action, give it a custom title.
For example, providing a duplicate Print action is unnecessary and confusing because people wouldn’t know how to distinguish your action from the system-provided one. Best practicesĪvoid creating duplicate versions of common actions that are already available in the activity view. For guidance, see Share and action extensions. Even though macOS doesn’t provide an activity view, you can create share and action app extensions that people can use on a Mac.
(An app extension is code you provide that people can install and use outside of your app.) For example, you might create a custom share activity that people can install to help them share a webpage with a specific social media service. You can also create app extensions to provide custom share and action activities that people can use in other apps. People can edit the list of actions to ensure that it displays the ones they use most and to add new ones.
By default, the system lists app-specific actions before actions - such as Add to Files or AirPlay - that are available in multiple apps or throughout the system. For example, Photos provides app-specific actions like Copy Photo, Add to Album, and Adjust Location. You can provide app-specific activities that can appear in a share sheet when people open it within your app or game. An activity view can appear as a sheet or a popover, depending on the device and orientation. People typically reveal a share sheet by choosing an Action button while viewing a page or document, or after they’ve selected an item. You will see a few things that are unusual in this code compared to standard Swift code, but thanks to Apple’s work on interoperability with Objective-C, it works just fine.An activity view - often called a share sheet - presents a range of tasks that people can perform in the current context.Īctivity views present sharing activities like messaging and actions like Copy and Print, in addition to quick access to frequently used apps. Not a lot has changed about it between iOS 7 and iOS 9.
UIActivityViewController is an Objective-C API. Today though, we are just going to cover the built in aspects of using UIActivityViewController in your Swift app. If you’ve paid any attention to WWDC a few years, you have probably saw that this is the new home for Share and Action extensions. With the Share Button you will allow people to share content to their Facebook timeline, to a friends timeline or in a group.
I think I originally started with “share sheet” and went on from there, so it may seem silly to point out something so obvious, but when I first tried, I knew what I wanted, I just had no idea what it was called. When I first learned about it, I didn’t even know what to search for. That interface is known as the UIActivityViewController. In several iOS apps, such as Safari or the Camera app, you can click a button that brings up an interface that makes it easy to send or share what you are looking at via messages, Twitter, Facebook, etc.