

Please make sure you unzip the file before emailing it to yourself.
#Swift share object between controller download#
You can test this out by emailing yourself a copy of the Swift Apprentice.btkr file from the Download Materials resource. btkr or files that have a mime type of application/booktracker.īelieve it or not, by setting these keys, you have told iOS to start sending your app files that end with the.

Here you define that your app can handle files ending in. The Exported Type UTIs entry gives some information about, since it isn’t a public UTI.You’ll need to make sure you have an icon for each of the sizes listed in the plist. Document types is also where you set the names of the icons that iOS should use when displaying your file type.The Document types entry defines what UTIs your app supports - in your case, the UTI, as an Owner/Editor.You can read up on what each of these values mean in Apple’s UTI guide, but here are the important things to note: So now it’s time to see it in action! Open ist and add the following entries under the Information Property List key: You’ll give iOS information about the UTI, such as what file name extension it uses, what mime type it’s encoded as when sharing and, finally, the file’s icon. You’re going to register your app to handle documents with the UTI representing the description of a book. There are UTIs already built into iOS for handling common document types such as public.jpeg or public.html.

In summary, UTIs are unique identifiers that represent documents. To do this, you need to register your app as being able to handle certain Uniform Type Identifiers, or UTIs, exporting any UTIs that are not already known by the system. The first thing you need to do is set up your ist to let iOS know your app can handle Book Tracker Documents. Here’s how you can start sharing wonderful RW books with everyone. Well, that’s no good there are no books to share. Build and run the starter project in Xcode and you’ll see the following: Getting Startedįirst, download the materials for this tutorial at the top or bottom of this page using the Download Materials button. Ready for some book sharing fun? Read on. Once set up, iOS can open your app with the URL pointing to the data to import or export. To set up sharing inside your app, you’ll have to configure some keys inside your app’s ist and handle a few system callbacks inside your app’s AppDelegate. You’ll learn everything you need to know to use this class in this UIActivityViewController tutorial! It may even net you some new customers!įortunately, since iOS 6, Apple has provided the handy, but much-overlooked, UIActivityViewController class, which offers a clean interface for sharing and manipulating data inside your app. Sharing is a convenient way for users to send data to each other or between devices. Andy Pereira wrote the original.Ī lot of developers want to be able to share their app data via email, Messages or AirDrop.
#Swift share object between controller update#
Update note: Owen L Brown updated this tutorial for Xcode 10.1, Swift 4.2, and iOS 12.
