App extensions allow you to perform various actions without running an app: share photos on Facebook, send files as an e-mail attachment or open an article. If you are developing an iPhone app and want to find out more, keep reading and learn how to add extensions to iOS apps!
I prepared a series of four articles that take up the issue of creating an app that serves to store and display a list of files. Maybe it doesn’t sound too fascinating, but trust me: it can be very useful.
Kickstart our iPhone app development
First we will need to create a project. To do that run the Xcode environment and select: File/New/Project…
Next, mark iOS/Application/Single View Application and click the “Next” button.
Name the app and select “Swift language”. Click the “Next” button and select a localization to save your project.
After creating the project, a workspace with an open settings file should display. At this moment we don’t change anything unless we want a different Deployment Target (if so, remember that it can’t be lower than 8.0).
Creating the iOS application view
Now, we can create the main app view, in other words, a chart which will display saved files.
Move on to the Main.storyboard
file, then add Table View controller to the already existing View controller and add all constraints with a 0 value so that the chart fills our whole view.
Open the ViewController.swift
file in Assistant Editor and add an outlet to our table.
Now we should move on to the implementation of proper delegates to the chart and files display mode but first, prepare needed elements to fill our table.
How to add extensions to iOS apps
First off, we have to add the extension to iOS app and then we’ll enable access to the shared resources. Select from the menu File/New/Target…
A window, from which you can select the extension type, should display now. Select the first one, Action Extension
, and click the “Next” button.
In the next window, choose the extension name. In my case it is the app name with added “Action” at the end of it (to suggest the extension type). If we want an individual style while using the extension, we have to leave the chosen Action Type
on the Present User Interface
. Click the “Finish” button to approve it.
The Target we’ve added should appear in our project settings. In the explorer we can see a directory with the extension name and its files.
Next on “How to add extensions to iOS apps”:
- enable sharing of the application resources
- create a manager for saving and reading files
Sources:
Photo by James Broad
YOU CAN HAVE A LOOK AT THE FINISHED APP IN OUR GITHUB REPO HERE.
Popular posts
Enhancing API Testing Efficiency with JavaScript in Postman
API testing is essential for good software, and Postman has made it easier by letting us use JavaScript to check our work. In this article, we'll see how using JavaScript in Postman helps us make sure our software is working right, saving us time and making our testing process smoother.
Read moreFlutter application template with GitHub Actions
This article explains how to create Flutter application template with GitHub Actions to save yourself time and nerves.
Read moreAugmented Reality as a trend in Mobile Development
3D maps, realistic games, virtual showrooms and fitting rooms, interactive participation in a conference or concert, visiting museums and exhibitions. These are just a few examples of where Augmented Reality can be used. Applications created with the help of AR effectively combine the real world with the virtual one. Can your business also benefit from […]
Read more