![]() As it turned out, all we have to do is ignore the generated code from the template and rely on Auto Layout to implement the UI that we want. In this post, we have seen how we could create a similar UI as the Reminders or Notes app for our Shared Extension. ConclusionĪnd that’s about it for this post. Similarly by adding more views into our controller we can achieve the custom UI that we want in our Share Extension. Then, we can call setupViews() from viewDidLoad() and if we run the app again we will see something similar to the following screenshot: In its place, add a new class named CustomShareViewController with the following content:Ĭlass CustomShareViewController : UIViewController Head to the ShareViewController.swift and delete the whole ShareViewController class. For this task, I am not going to use the Storyboard but rather build the UI programmatically. The extension that we have created consists of 3 files the ShareViewController.swift, the MainInterface.storyboard and the ist. Now that we have our extension in place, let’s see how we can change the UI to look more like the Reminders app. If you now run the extension against Safari using a Simulator you will get a UI similar with the image mentioned before. Name it as you wish and press Activate on the pop up that will be displayed after that. There, search for and choose the Share Extension option from the list of the templates for an iOS app. First, use the top menu to navigate to File > New > Target. Let’s see how this can be done step by step. Instead, we have to provide our own implementation. As a result, we will no longer rely on the methods like isContentValid and configurationItems. Long story short, the answer is that we can definitely achieve a design like this by creating a Share Extension as usual, but this time removing the conformance to SLComposeServiceViewController. Hmm!! Is it possible to achieve a similar design for the Share Extension of our app? This is the question I will try to answer in this post. Now, if you try to run the target in Safari, it will look like the following screenshot.Ĭomparing this with the UI of the Share Extension of other apps, you will find out that apps like the Reminders have quite different UI, which is more appealing, covers the bigger part of the screen and thus allowing the user to focus on the task in place. As a result, the UI is quite predefined and there is little you can do to interfere with it. The target created by this templates contains, amongst others, a ViewController that complies to SLComposeServiceViewController. This extension makes your app appear on a list of apps when the user presses the share button on apps like, for example, a webpage on Safari, an image on Photos, a simple text and so on.Īdding a Share Extension to your app is straight-forward since Xcode offers a Share Extension template that you can use when creating a new one. ![]() ![]() ![]() An example of such extension, and the topic of this post is the Share Extension. IOS comes with a plethora of App Extensions that you can use to improve the functionality and the user experience of your app.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |