Introduction
In this article, we will learn how to access the camera and Photo Library in iOS app development. This is the key feature and a very important one because the clients often require these features in their app. If you are familiar with Android app development, then you can easily access the camera because it is similar in both systems. But, if you are not familiar with Android, follow my article and concentrate on each step. It’s not too hard. So, let’s get started.
Step 1
Open the Xcode (IDE) and create a new project. Give it the name as “CameraApp” and press Next. Now, choose the Single View Application and set the application type to universal. Then, finish creating the project. After that, drag two buttons and one image View from the object library and drop it into the Main Storyboard file. Make the interface like the following.

Step 2
Now, at the top position in the right side, you see the Assistant editor option. Click on this. Now, your coding screen break into two parts. Next, we make the outlet of two buttons and one image View, like the following:

Step 3
Now, you make action of two buttons, known as Photo Library and Camera. Remember that the action is created after the didRecieveMemory function. Also, remember that you need to select the connection type action not outlet.

Step 4
Now, you have two outlets. One is Photo Library and another one is camera. At the top, you can see the ViewController class inherits the UIViewController class. Now, you can declare two more classes after UIViewController. I also have given the code of two buttons. Paste this code into outlet action and your project is ready.
Code
Join the conversation! Your thoughts help the community grow.
Sign in to leave a comment
It is the same account you read, post and publish with — and you will come straight back to this page.


Vignesh ManiPosted Jul 27, 2016, 12:08 PM
Nice one
Prasanna MuraliPosted Jul 25, 2016, 9:15 PM
Nice share
kalu singh raoPosted Jul 25, 2016, 2:39 PM
Nice share