How to make a camera application in iOs 9

Home/Uncategorized/How to make a camera application in iOs 9

How to make a camera application in iOs 9

In iOs 9 some changes are made in connecting to the camera to get pictures from it.

Here is a simple example to what you have to do to make it work.

The how to is going step by step and will cover all the basic aspects. The full code of the working example can be found on GitHub

Please enjoy and I will be really happy to get feedback.

  • Create a new Single view application in XCode.

Screen Shot 2016-01-08 at 00.12.38

  • Fill application details parameters.

Screen Shot 2016-01-08 at 00.13.31

  • Select your developer account. If something is missing you will have a message with the warning and also a “Fix It” button. Press the button and XCode will do it’s magic. Actually in 7.2 is working really nice and smooth.

Screen Shot 2016-01-08 at 01.11.29

  • Connect your device to the computer using the USB cable and let’s run the just created application.
  • There are two major possibilities. It’s running so everything is fine or you just got on the computer an error “Security”. In this second case you should go into your iOs device Settings. Inside go to “General”. Inside almost in the end you can find “Profiles & Device Management”. Get inside. You will have a section “DEVELOPER APPS”. Usual you email account is there. When you press on it you will have a dialog where you can say that you “Trust” this developer applications. Now you are invited to repeat the previous step. Try to run the app. Actually now we should have an empty running application.
  • Let’s start adding to the storyboard the basic objects:
    • ImageView – here we will show the selected picture from photo library or the picture taken by the camera
    • Button – button to open the photo library
    • Button – button to open the camera

Screen Shot 2016-01-08 at 00.36.30

Screen Shot 2016-01-08 at 00.40.37

The ImageView shall be located in the middle of the screen and stretch it to the margins of the screen. Don’t forget to add the constraints if you want to make it look really nice.

I located the buttons on the bottom of the screen. The reason for that is that I prefer to have them close to the places where is easier to get with the fingers.

2017-01-05T11:39:15+00:00 January 8th, 2016|Uncategorized|0 Comments

Leave A Comment