How to make an iPhone app

Author: Ellen Moore
Date Of Creation: 20 January 2021
Update Date: 29 June 2024
Anonim
iOS Tutorial (2020): How To Make Your First App
Video: iOS Tutorial (2020): How To Make Your First App

Content

The app market is constantly moving and changing. So many success stories have already appeared that everyone knows about them. Do you think you have a great idea for an iPhone app? It can be easier to create than you think. Although you will need to learn how to code, most of the interface work can be done graphically. It will take time, study and patience to create an app, but maybe you can create the next Flappy Bird game! Skip to step 1 to get started.

Steps

Part 1 of 5: Setting up your development environment

  1. 1 Download and install Xcode. Xcode is the development environment where all iPhone apps are built. Xcode is available for free from Apple, but it requires OS X version 10.8 or later to be installed. There is no official way to run Xcode on Windows or Linux. This means that if you want to develop an application on the iPhone, but you don't have a Mac, then you have to buy it first.
    • To develop apps for iOS 8, you need Xcode 6.0.1 and the iOS 8 SDK. Both can be obtained from Apple. The iOS 8 SDK contains a fairly large number of new APIs that will allow you to create all kinds of new applications, including integration with iCloud and Touch ID.
    • To develop apps for iOS 10, you need the iOS 10 SDK available on Apple's website. The Swift programming language and SDK have undergone significant changes in this release of Xcode. The good news is that there will be even more code changes in Swift after this release.
  2. 2 Install a good text editor. While you can do everything in Xcode, you will soon find that working with large code sizes is much easier if you have a separate text editor that specializes in programming. The two most popular options are TextMate and JEdit.
  3. 3 Install a vector graphics program. If you are planning to create images and designs for your application, you will need a vector graphics program. Vector graphics can be scaled without loss of quality, which is essential for any good looking application. Popular vector programs include CorelDraw, Adobe Illustrator, Xara Designer, and Inkscape. A good free graphics editing program is DrawBerry. It is not as powerful as professional software, but it is good for beginners or for those who do not want to pay for something that they will only use once.
  4. 4 Learn Objective-C. Objective-C is a programming language that is used to create functionality in iPhone applications. It processes data and works with objects. Objective-C comes from the C family of languages, and it is an object-oriented language. If you already understand C or Java, it will be enough for you to just learn Objective-C.
    • Now you can use the Swift language, the successor to Objective-C. Swift has simpler syntax and is more modern.
    • Although it is possible to build a basic application without knowledge of Objective-C, you cannot accomplish any advanced functionality without the need for programming. Without Objective-C, all you can do is move back and forth across screens.
    • There are many tutorials on the Internet, and a lot of information can be found in various Objective-C books. If you want to get serious about iPhone app development, you will find some of these resources useful.
    • Some of the most popular online Objective-C communities include the Apple Developer Forums, the Google iPhoneSDK group, and StackOverflow.
  5. 5 Consider an outsourced development option. If you have no desire to learn Objective-C, or you have no artistic streak, there are a large number of freelancers and development teams that can complete the various parts of the project for you. Outsourcing your development is a tricky process, but it will save you a lot of trouble if you are not a programmer. Make sure everyone who will be working has a nondisclosure agreement and that you have agreed on payment before starting work.
    • Upwork (a merger of the former oDesk and Elance) is the most popular freelance exchange on the Internet, with hundreds of developers and artists of all skill levels.
  6. 6 Create a developer account. To distribute your app in the App Store or give it to others for testing, you'll need to register to get an Apple developer account. The account costs $ 99 per year and will require you to enter your tax and banking information.
    • You can create your account on the iOS Dev Center website.
  7. 7 Download some test applications. Once you've signed up for a developer account, you have access to Apple's development resources. These resources include many example projects that can give you a tremendous amount of information about how applications are developed. Find an example related to the type of application you want to build and practice with it in Xcode.

Part 2 of 5: Planning the Application

  1. 1 Define the concept. Before you open Xcode for the first time, you should have a well thought out blueprint for your application and its capabilities. This could include a design document that captures all the functionality of an application, sketches of the user interface and transitions between screens, a basic idea of ​​the types of systems that will need to be implemented.
    • Try to stick to the design document as much as possible when developing your application. This will help you focus on the capabilities you need.
    • Try to draw at least one sketch for each screen in your application.
  2. 2 Define your target audience. The audience for your application is very dependent on how the application looks and on its functionality. For example, an app with a to-do list will have a different target audience than a shooting game. This will help you.
  3. 3 Think about what the application is for. If your application is a utility, it should offer a solution to the problem that no one has previously suggested, or you need to offer a better solution than previously suggested. If your application is a game, then it must have a unique feature (or features) that will set it apart from other games and attract specific players.
  4. 4 Examine the content. Your user interface will be dictated by the type of content that you display to users of your application. For example, if your application works with photos, you want the user interface to allow you to browse and navigate photos as easily as possible.
  5. 5 Practice creating a good UI. The user interface should never get in the way of the user. This means that the options should be clearly visible and the user should never have to wonder what any button does. If you use icons, they should clearly represent their function. Navigation through the application should be flexible and natural.
    • User interface development is both an art form and a science. Chances are, you will be constantly revising your design as the project evolves.

Part 3 of 5: Creating an Application

  1. 1 Create a new project in Xcode. Open Xcode and start a new project from the File menu. Select "Application" under the "iOS" heading on the left side of the window. In the templates section, select "Empty Application".
    • There are many ready-made templates, and all are designed for different tasks. Start with a blank template until you understand the development process. You can try one of the more complex patterns once you figure out how it works.
    • You need to provide the product name, your company ID and class prefix. If you don't already have an Apple ID, enter com.example... For the class prefix, enter XYZ.
    • Select "iPhone" from the device menu.
  2. 2 Create a Storyboard. Storyboard is a visual representation of all screens in your application. It displays the contents of each screen as well as the transitions between them. The Storyboard tool helps you design your application.
    • Choose File → New → File.
    • Under the iOS heading, select "User Interface".
    • Select Storyboard and click Next.
    • Select iPhone from the device menu, and then name the file "Main". Make sure you save it in the same place as your project.
  3. 3 Assign the Storyboard to your project. Once you have created a Storyboard, you need to designate it as the main interface of your application. Then this Storyboard will be loaded when the application starts. If you don't assign a storyboard, nothing happens when the application starts.
    • Click on your project name in the navigation tree on the left.
    • Find the Targets heading in the main window. Select your project from the Targets list.
    • Find the Deployment Info section under the General tab.
    • Enter Main.storyboard in the "Main Interface" text box.
  4. 4 Add your first screen using a view controller. View controllers determine how the content will be viewed by the user. There are many predefined view controllers, including standard views and tables. You will be adding view controllers to your storyboard, which tells your application how to display the content to the user.
    • Select your "Main.storyboard" file from the project navigation menu. You will see a blank canvas appear in the Interface Builder window.
    • Find the Object Library. It is located at the bottom right side and can be selected by clicking on the button with a small cube. This will load a list of objects that can be added to your canvas.
    • Click and drag the "View Controller" object onto your canvas. The first screen will appear on your canvas.
    • Your first "Scene" is over. When you start the application, the view controller will load your first screen.
  5. 5 Add interface objects to your first screen. Once you've defined the view controller, you can start placing the interface objects you want on the screen, such as labels, input text fields, and buttons. All interface objects can be found in the Objects Library list, which can be found inside the View Controller object.
    • Select and drag objects from the list and add them to your screen.
    • Most objects can be resized by clicking on the border of the object and moving it. As you resize, guides will appear on the screen so you can make sure everything looks right.
  6. 6 Modify the objects you added. You can change the properties of each object, allowing you to create a personalized and intuitive interface. For example, you can add alternative text to an input text field that prompts the user about what to enter.
    • Select the object you want to modify and click on the "Attributes Inspector" button at the top right side. The button looks a bit like a shield.
    • Modify the object as you like. You can change the font style, font size, text color, alignment, background images, alt text, border style, and more.
    • The existing options will change depending on which object you are modifying.
  7. 7 Add more screens. As your project grows, you will likely want to add more screens to display all the content your application needs. For example, if you are building an application with a to-do list, you will need at least two screens: one for entering a to-do, and one for viewing the to-do list.
    • Additional screens can be added by moving and releasing the view controller to an empty area of ​​the canvas. If you cannot find a blank area, to release the mouse, click on the "zoom out" button until the blank areas appear. Make sure to drop the view controller onto the canvas and not the existing screen.
    • You can change the start screen by selecting the view controller you want to host in the project window. Click the Attribute Inspector button and check the "Is Initial View Controller" checkbox. For example, if you are making a to-do list, you want the to-do list itself to be the first thing the user sees when they launch the application.
  8. 8 Add a navigation bar. Now that you have two screens in your application, it's time to make it so that the user can navigate back and forth between them. You can achieve this using the Navigation Controller, which is a specialized version of the View Controller. This controller adds a navigation bar to the top of your application, and allows the user to navigate back and forth between screens.
    • A navigation controller must be added to your initial view so that it can control all subsequent screens.
    • Select an initial view in the project window.
    • Choose Editor → Embed In → Navigation Controller.
    • You should see a gray navigation bar appear at the top of the screen where you added the controller.
  9. 9 Add functionality to this navigation bar. Now that you've inserted the navigation bar, you can start adding navigation tools to it. This will allow the user to move back and forth between screens.
    • Add a title to the navigation bar. Click on the Navigation Item below the view controller you assigned it to. Open the Attribute Inspector and enter a title for the current screen in the Title field.
    • Add a navigation button. Open the Objects library, if not already open, and find the Bar Button there. Select it and drag it to the navigation bar. Typically, buttons that move you "forward" in an application are on the right, and buttons that move you "backward" are on the left.
    • Give the buttons properties. Buttons can be customized with special properties that allow them to easily adapt to different environments.For example, if you are creating a to-do list, you may need the Add button to create a new entry. Select the button and open the Attribute Inspector. Find the Identifier menu and select Add. The button changes to the "+" logo.
  10. 10 Link your new button to your existing screen. For your button to function, you need to pair it with another screen. In our example with a to-do list, the button will be located in the general list, and it needs to be associated with the case entry screen. To bind a button, hold down the button Control, and drag the button to the second screen.
    • When you release the mouse button, the Action Segue menu appears with a list of options. Select "Push" to use moving between screens. You can also select "Modal", which will open the screen as a completely independent one, without a sequence of screens.
    • If you are using Push, a navigation bar will automatically be added to your second screen, as well as a back button. If you choose modal, you will need to manually insert a second navigation bar and add the Cancel and Done buttons (in the to-do app; your app will have different buttons depending on the needs of your app).
    • You can create the Cancel and Done buttons in the same way that you created the Add button. Just select Cancel and Done from the Identifier menu in the Attribute Inspector.
  11. 11 Use the power of data processing. Up to this point, it was possible to create a basic interface without having to write any code. If you want to add deeper functionality such as storing data, handling user input, you need to dive into coding. Coding is outside the scope of this article, but there are many Objective-C tutorials on the Internet.
    • You can use a prototype navigation interface when hiring a developer. If you have a working interface, it is much easier to explain what you need from the program.

Part 4 of 5: Testing the Application

  1. 1 Start the iOS Simulator. Xcode comes with a built-in iOS emulator that allows you to test your app on a range of emulated iOS devices. To run the emulator, select Simulator and Debug from the menu at the top of the Xcode window, and then select the device you want to test on.
  2. 2 Build the application. Click on the Build button, which looks like a regular Play button, to compile and run the application. It can take several minutes to build the application. On the panel, you can watch the progress. Once the build process is complete, the iOS Simulator will open and you can start testing your app.
  3. 3 Test the app on your own iPhone. Before distributing your app for testing, you can test it on your own device (if you have one). First, connect your device to your computer via USB. If iTunes opens, close it. Select "Device and Debug" from the drop-down list and then click on the Build button. After a few seconds, the app should launch on the iPhone. Check all functionality before closing the application.
  4. 4 Debug. If the application crashed, you need to determine what happened and why. There can be an infinite number of reasons. Open a debug console and read error messages. More often than not, they will not be very clear. If you don't understand the error, try searching for error messages on Google. There is a chance you may stumble upon a post left on the Apple Developer Forum where a developer has already answered a question.
    • Debugging an application is a long and tedious process. If you don't give up and persist, you will get better over time. You will begin to recognize errors, find them quickly, and sometimes even expect them. A common mistake is to free the memory of an object more than once. Another common mistake is if you forget to allocate memory and initialize an object before trying to add or assign something to it.With each application, you will have fewer and fewer bugs.
  5. 5 Check memory usage. The iPhone has little memory. Each time memory is allocated for an object, it will need to be freed upon completion of work with it. There are tools such as the iPhone SDK that can be used to view and analyze memory usage, among other things.
    • With Device and Debug selected, choose Run → Run with Performance Tool → Leaks. This will launch the Tools and, along with it, the application on your device. Now start using the application as you normally would. It will slow down a little at times as the program records and analyzes memory usage. All sources of leaks will be displayed at the bottom of the screen.
    • Double-clicking on any object will open the corresponding code for you, and clicking on the small arrow in the Address column will open the history of the memory problem. Sometimes the place where the leak is found is not at all where it came from.
    • If you are stumped, try the elimination method. Comment out something, carefully omitting some area of ​​the code, and then run it. Sometimes you will be able to narrow down your search, and then perhaps find the string you want. Once you know where the error is, you can fix it or rewrite it. Remember, using Google can give you direct links to Apple forums or documentation describing your case.
  6. 6 Share your test app with other people. While testing your application in an emulator is a good way to make sure it works and has a beautiful interface, nothing beats testing with other users. Just make sure you've removed the most annoying bugs before submitting your application for external testing. To distribute your app to testers, you'll need to create an Ad-Hoc certificate on the iOS Dev Center.
    • External testers can give you a lot of feedback that you didn't expect. This is especially useful if you have a complex application.
    • To authorize testers' devices, you need to know the UDID number of each device.
    • Select a device from the dropdown menu and click on the "Build" icon. In the Finder, go to your project folder, find the "Ad-Hoc-iphoneos" folder there. Inside it will be your application. Copy the "AdHoc.mobileprovision" certificate that you received from the iOS Dev Center to the same folder. Select the application along with the certificate and zip them. This archive can be transferred to an external tester. You will need to create a separate archive for each Ad-Hoc certificate.

Part 5 of 5: Publishing Your Application

  1. 1 Build your build of type Distribution by choosing device and build type from the drop-down menu, then click on the "Build" icon. Open your project folder in Finder and find the "Release-iphoneos" folder. It will contain your application. Zip it.
    • For new apps to be Apple certified, they must be optimized for iOS 8 and retina-type displays.
  2. 2 Open the iTunes Connect menu. You can get to it from the iOS Dev Center. If you have unfinished steps, it will be written at the top of the screen. Make sure all your banking and tax information is entered correctly.
  3. 3 Enter all information about your application. Click on "Manage your application" and then select "Add new application". Enter the app name, SKU and budle ID. Select your application bundle from the dropdown menu.
    • Fill out the form with app description, keywords, support site, category, contact email, copyright, etc.
    • Fill out the Entitlement and Pricing forms.
    • Your iTunes pictures should be ready. You will need a large 512x512 icon, as well as a few screenshots of your application. Screenshots can be taken from the iPhone simulator using ⌘ Command+⇧ Shift+4, and dragging. Check that they are 320x480 for iPhone. Screenshots are a very important part of your app's marketing, so make sure they capture the most important parts.
  4. 4 Download your app. Click on "Ready to Upload Binary" and you will be taken to a screen that prompts you to download the Application Uploader tool. Download it and click Finish.
    • Install Application Uploader tool and run it. The first time it will ask you to enter your iTunes credentials.
    • The Application Uploader tool will check your iTunes Connect account and find all applications for which a binary can be uploaded. Choose what you want, select the zip file you created earlier and download it. The loader will check some of its stuff, and will indicate errors if it finds something wrong. This could be the version number, missing icons, etc. If all goes well, download the zip and you're done.
  5. 5 Wait for verification. You have nothing to do but wait for the verification process to complete. Apple will notify you in a few days or weeks by email if your app status changes to "In review". When the application enters this stage, the rest happens very quickly. If the app doesn't pass the initial test suite, you will receive a rejection email that same day telling you why the app was rejected. Also, the letter will contain Apple's recommendations for fixing it. If your app passes validation, Apple will send you an email informing you that your app is ready for sale. Your app will now appear in the iTunes App Store.
  6. 6 Advertise your app. Your amazing app is now available for purchase, and it's time to start spreading the word about it. Use social media, send a press release to app sites, make some YouTube videos, and whatever you want to do to get people to talk about your app.
    • You can send free copies to reviewers who post about your app on their website or review on their YouTube channel. If you are lucky enough to get into the hands of popular people, it can lead to a lot of sales.
  7. 7 Track sales. Download the free iTunes Connect Mobile app for your iPhone, and log in and track your sales, markets and countries of sale every day. This is the fun part! Apple will from time to time send you emails with links to the latest sales data. You can download them for reporting. Good luck!

Tips

  • Be original, do not copy applications already existing in the AppStore. Research the AppStore thoroughly to see what is there. Of course, if your idea is better than all the others, you can get started.
  • Always look for ways to improve your app.
  • Try testing the app on as many i-devices as you can find. It's even better if they have different versions of iOS installed.
  • If you love paper books, head over to Amazon.com to find books on iPhone development.

Warnings

  • The iPhone SDK is constantly changing, and so are the devices. If there was an SDK update while working on a project, read what's new before using the new SDK. This is not necessary at this stage, unless Apple says that all new downloads must be compiled with the new version of the SDK. If you upgrade, some of the methods you use may become deprecated. Although this will most likely result in a compile-time warning at most, it's best to be safe.
  • When you are successful and your app appears in the App Store, don't be angry with those who give your app a bad review. Some provide helpful feedback, and some just like being rude.
  • Nobody guarantees you a lot of downloads or sales, but don't be upset.
  • Application development is fun; you cannot stop.