How to set up smartphones and PCs. Informational portal
  • home
  • OS
  • The Swift Playgrounds app makes programming easy and fun. Is it possible to develop on an iPad?

The Swift Playgrounds app makes programming easy and fun. Is it possible to develop on an iPad?

Submitted by AtH on Mon, 08/02/2016 - 04:17

For several years now, I have been keeping a list of the most interesting applications for iPhones and iPads, namely calculators (including emulators of Soviet and foreign PMCs) and programming tools - from text editors to compilers. The list will also include documentation, tools for creating websites and editing web pages, spreadsheets, mathematical packages and many other useful tools.

As of May 16, 2018, the list has received 7,603 views and contains 276 best apps. This is 31 web pages. Emulators of HP programmable calculators start on page 6, and Soviet PMKs on page 11. Web programming now starts on page 19, and more serious languages ​​start on the next page and page 23. Page 27 begins applications related to the TeX package. I included only the best in the list, in the best configuration. For example, the powerful (and relatively HP 50g compatible) $2.99 ​​ND1 programmable calculator has a free, stripped-down version of the same author's ND0 that is not listed.

As of February 8, 2016, 46 of these applications are free (may contain in-app purchases), and all the rest cost $1083.67 USD - that is, more expensive than the iPhone itself. However, you don't have to buy them all. Functionally, many applications duplicate or overlap each other's capabilities, and for many tasks there are inexpensive or even free apps. Of the paid apps, 75 cost $0.99 and another 33 cost $1.99. 18 apps cost $9.99 and only 15 apps cost more than that. The following four apps cost more than $20 (prices as of February 8, 2016):

  • $39.99 - MathStudio mathematical package (can be purchased at half price during discounts). Online version is free at mathstud.io
  • $29.99 - TI-Nspire™ CAS branded calculator (on sale three years ago for $4.99). The “iron” TI-Nspire CAS (English) on Amazon costs $118.88 plus shipping.
  • $29.99 - AppCooker, a tool for developing a prototype application on the iPad (there are sales, even giveaways)
  • $24.99 - i41CX+, a version of the programmable RPN calculator HP-41CX (English) with printer ribbon and CAS (there were no sales; in the fall the seller raised the price to $30.99). There is a version of i41CX for $7.99 plus IAP, and separately iCAS for $14.99

For programming and other development, one cannot fail to note the following impressive applications (the full list, I repeat, is 279 applications):

  • Coda ($9.99) - Professional website development and support. Editor with syntax highlighting, FTP upload, etc., SSH client, preview and viewing “over the air” on a computer... Coda even works on an iPhone.
  • Smart BASIC ($6.99; some sales down to $0.99) - incredible powerful version BASIC for on-board programming; compilation and creation is possible on a Mac full-fledged application With using X-code. Written by our compatriot Elena Kolchina. Read the review on iPadStory for more details.
  • Codea ($14.99) is a similarly powerful development environment, but for the Lua language. Works only on iPad. To program in Lua on iPhone, there are other applications.
  • Pythonista ($9.99) - development environment for Python. The German Pythonista app website has English documentation and a forum.
  • DraftCode PHP IDE ($6.99) - a complete integrated development environment for PHP, with a built-in web server. Allows you to develop applications in PHP offline.
  • Retro ($0.99) is an actively developing concise programming language inspired by Forth. Retro went much further from the Fort than mine. The author dedicated his website to Retro.
  • TeX Writer ($9.99) - A complete environment for TeX/LaTeX with compilation to PDF. Also works offline.
  • MyScript MathPad (free, but full version$2.99 ​​as IAP) - you draw a formula on the screen, the application translates it into TeX code. I sometimes use it when working on

Probably even after buying your first mobile gadget from Apple, you've been wondering how to get more out of it than listening to music and reading books. Yes, there are tons of software for all occasions, but what about checking out your application from GitHub, making changes to it and then uploading it to the server via SSH? But it is quite possible to do this if you know how.

This article presents a selection of tools for programmers and administrators who, for one reason or another, need to work without access to a desktop. Of course, these programs are not as good as their “desktop” counterparts, but their capabilities will be able to cover a considerable part of the needs of people who create programs or are just starting to do so.

Code editors

The simplest tool for a programmer is a code editor. There are dozens of such programs for many platforms, and iOS is no exception. The general requirements for such a utility are brevity, support for a large number of languages, integration with cloud services. IN iOS important becomes one more parameter - since the keyboard is not suitable for typing code, either another keyboard is needed, or the ability to integrate into an existing one additional buttons with the most commonly used special characters. Let's consider the most popular editors code that meet these requirements and also have their own unique capabilities.

As you know, Apple does its best to prevent the possibility of running on its own mobile devices ah, third party apps. Programs for unjailbroken iPhones, iPod touch and iPad can only be purchased through Apple store App Store, and developers have to pay $99 a year for the right to test applications on their devices. Unfortunately, this policy prevents application development tools from appearing on the devices themselves. However, the creator of the Codify program, which makes it possible to use the iPad to write programs (primarily games) on Lua language, managed to achieve approval in the App Store.

In June 2011, Apple slightly revised the rules for publishing applications in the App Store and now allows programs to include tools for interpreting various scripting languages. First of all, this is necessary for game developers, since they often use high level languages. What Apple does not allow you to do is download arbitrary code from external sources. If such an opportunity appeared somewhere, it would threaten the birth of an alternative App Store, which Apple really doesn’t want.

The author of Codify had to make serious restrictions in order for the software to be approved in the App Store. At the moment, there is only one way to add code to the Codify editor - write everything manually. There are the same problems with export. To rip out what you wrote in Codify, you will have to select all the code, copy it and email it to yourself. However, this method is only suitable for creating backup copy or sending the source code to one of your friends. Transfer the application to desktop computer anyway, it won’t work without extra work - the author does not offer to download the Codify environment, such as the graphic libraries included with the development environment. It's a pity. If he published a template Xcode project with all the libraries, then the sources pulled from Codify could be immediately turned into an independent application.

Codify has other limitations. For now, the games created there can only use sprites from standard set; You won't be able to choose your own picture. However, the application also has advantages - for example, added to on-screen keyboard buttons that allow you to quickly navigate through the program text, or color or sprite selection dialogs that substitute values ​​directly into the list of parameters for the corresponding functions. Codify also comes with good help on all available functions (graphics, sound, mathematical functions, external parameters, working with the touchscreen and accelerometer).

Codify costs eight US dollars and is available in the Russian App Store. Let's hope that this initiative doesn't die out and doesn't become another victim of the fickle mood of App Store moderators. I would like to see the same development environments for other languages ​​and with other libraries, to Python example or Processing. If Codify’s access to user iPads is not an accident, but the beginning smooth change strategy, it is possible that Apple itself is thinking about how to make the iPad suitable for programming. And that would be simply great news.

This article begins a series intended for beginners. I dare to hope that the level of presentation of the material will allow even people unfamiliar with programming to understand it. Let's start our story with a small lyrical digression. Applications for iPhone and iPad are written in Objective-C. This language was widely used at NeXT and came to Apple after the return of Steve Jobs. Currently, Objective-C is the main language for developing OS X and iOS applications.

In order to start programming for iOS, you will need Mac computer on the base Intel processor and the XCode development environment. If you don't have a Mac, it doesn't matter. Perhaps one of the described methods for solving this problem will suit you. We will focus on XCode 4 and iOS5.

Installing XCode

First, we will have to register on Apple's dev site. Follow the link and click on register. Click the Get Started button and complete the registration process. Everything is quite simple there, so I won’t dwell on this point. After registration, you will be sent an email with your Apple ID. Return to the Apple Developers page and use it to enter the secure area. In the DevCenters section, click the iOS link. As you can see, Apple offers you a ton of documentation, sources, and tutorials. This page has everything you need to get started with iOS development. At the very bottom there is a Download Xcode button that you need to click. Once downloaded, install Xcode on your Mac.

Getting to Know the XCode 4 Interface

To launch Xcode, go to your main disk and click on developer>Applications.

Once Xcode has launched, select File>New Project, then Single View Application and enter HelloWorld as the Product Name. As a result you should see something like this

All your code and resources are organized into special folders, which are located on the left side of the Xcode window. The panel is called "Project Navigator" and contains all the elements of your program. Files with source code have the extension ".h" and ".m". If you click on such a file, an editor with the code will open on the right side of Xcode.

Let's not dwell on the code for now. We will return to this issue a little later. If you look at top part screen, you will see several buttons related to your project. Let's study this panel in more detail.

The "Run" button starts your project. You can test your application and make sure it actually behaves the way you expect it to. The "Tasks" button stops the running application.

Using the Schemr button, you can select the target platform where your application will run. Here you can choose a simulator and debug the program on your computer, or run it on your iPhone (iOS Device) if you paid the $99 fee. The only advantage that this payment provides is the ability to run the program on a real device and publish it in the App Store. I would not recommend that you spend money until you have a normal program ready.

Breakpoints are a very useful thing. Using this button, you can mark lines in the source code, and when the program reaches the marked line during execution, the program will pause and you can view the state of the variables. This is a very powerful and widely used tool.

Click the "Run" button. You will see an emulator window with your project. As you can see, while it does not shine with functionality, it is just a blank.

Programming for iPhone - The first step

Enough beating around the bush, let's code something. The Project Navigator window contains source code files. Click on some .m file. Please note that some lines are colored green color- these are comments that serve as cheat sheets. In order not to get confused in the code, the programmer can leave hints and explanations for himself. To denote comments in the C language, the combination of slashes // is used. Everything on the line to the right of these characters is considered a comment. If you want to write a multiline comment, you can use the combinations /* and */ to indicate the beginning and end of a multiline comment.

Before we start writing the application code, I need to explain a few concepts to you with my fingers: OOP (Object Oriented Programming), MVC (Modal View Controller), ".h" and ".m" files. So... object-oriented programming involves dividing all code into so-called objects, within which data and the commands that process it are stored. An object in Objective-C consists of two files.h and .m. The file.h is called the header; it contains a “sketch” of the object - all data and names of command blocks (methods) contained in the object are listed. The .m file is called the implementation file and it describes in detail everything that is indicated in the header; this is where all the program logic is programmed.

MVC (Model View Controller) is something that separates the code and the interface that the user sees. Model is the user data and the data you show to the user. View is user interface and code that provides communication between View and Model. The concept of MVC may seem too abstruse to you now, but over time you will see that this approach really simplifies the life of a programmer. This concept implies the following order of work: the programmer separately creates an application design template, where he places all the buttons, text fields and other important nonsense, and writes programs separately. Then it shows XCode which method (block of code) should be called in response to a particular user action and what name this or that control element has in the program text.

We develop a program design for iPhone

Let's start creating our application by developing the design. In the Project Navigator window, click MainStoryboard_iPhone.storyboard. As a result, XCode will launch the interface editor.

In the lower right corner you see a list of objects (Library) that can be used in your interface; in the central part the View window is displayed, which represents the layout of your program’s interface. The upper right window has several modes, which are switched using the icons located above the window. The figure shows the Attribute Inspector mode. Here you can change various attributes of the objects that make up your interface.

Let's drag a Label object from the Library window onto our window layout. Using the mouse, we will change the size of the object, as shown in the screen below. The inspector displays the properties of the Label object. Let's center the text by clicking on the corresponding icon in the Layout line.

Let’s delete the text in the Text field (the word Label was written there) and enter “Some String” there.

Similarly, add a button to the layout (Button object)

So, we have developed the design of our application. Nothing complicated, you can click the Run button and look at the work of your program in the emulator window.

Let's start coding

So, we have two visual components placed on the layout. We want the text in the line to change when the button is clicked. To implement this idea, we will need to access a row (Label object) from the program code and call a method (block of code) when the button is pressed.

Click on the "ViewController.h" file in the left panel. We are going to describe IBOutlet. IBOutlet connects our code to a visual object, such as a label or button. Change the code in the ViewController.h file to look like

#import @ interface ViewController: UIViewController( IBOutlet UILabel* label; //give our string the name Label } //this is the header of the method that will be //called in response to a button click- (IBAction) buttonClick: (id) sender; @end

This is all we need to write in header file. IBAction allows you to connect a method to a user interface element, for example, in response to a button click, the program code we have written will be called.

So, we said that we will call the string with the text label and that the buttonClick method will be called in response to user action. Let's write the code for this method. Let's switch to the ViewController.m file in the project tree. After the line @implementation... add the code

- (IBAction) buttonClick: (id) sender( label. text= @ ”Hello from Mobilab. ru”; )

Note, if you copied this code, you will probably get an error when you run the program, most likely the problem is in the quotes. Delete them and enter them from the keyboard.

Let's figure out what we see here. We access the label object - a line of text on the screen. Since this is an object, it has various data inside it (which in OOP are also called object properties) and methods that can be accessed by placing a dot after the object name. The text property is responsible for the text contained within a string.

We've completed the coding, all that's left is to associate the label and buttonClick with the elements inside the design layout. Click on the MainStoryboard_iPhone.storyboard line in the Project Navigator window to switch to the interface designer. Then click on the “View controller” icon. Switch to connections mode in the inspector (last icon). Look, the label line has appeared in the Outlets area of ​​the inspector. This is the name that we specified in the ViewController.h file. Click the circle on the right side of the label line and drag it onto the Some Text line in the design layout.

Do a similar operation with the button. Click on the button with a circle in the “Received Actions” group, then click on buttonClick and drag it onto the button in the layout. As a result, it will open context menu, with which you can select when to call the method. You can, for example, call the code when the user presses the button, or when he releases it. There are many options. Select "Touch up Inside".

That's all! Save the project and click on the "Run" button on the top panel. If you did everything correctly, the emulator with your program should start. Click the button. The text in the line should change. That's all. The first lesson is over

The profession of a programmer is one of the most prestigious and in demand, that’s a fact. In the development industry software have their own niches. Of these, the fastest growing, and at the same time the most highly paid, is software development for mobile devices. As you know, it just so happened that, leaving their competitors far behind, three constant rivals took the lead. The trick is that one of these three is the undisputed leader, while someone always catches up.

In the mobile technology segment, Apple is undoubtedly the leader with its iPhone smartphone. At a presentation held in September, the Cupertino company demonstrated the 7th version of the mobile device. Along with it, Apple introduced a new version of its mobile operating system. iOS systems 10. Now it is the most significant operating system in the world, like its predecessors. It follows from this that learning iOS development is the most profitable investment time and money.

Apple ecosystem

Today we will develop a simple mobile application for iOS. Of course, a native Mac is best suited for this. But if you are a Windows supporter or you simply don’t have a Mac, you can install operating system macOS under virtual machine on Windows. In the vastness of the Internet, it won’t be difficult for you to find one specially designed for PC. macOS version, popularly called Hackintosh. Feel free to install it on a VMware virtual machine, VirtualBox - your choice. Let me warn you right away that the PC keyboard does not have some of the keys that are on the Mac keyboard, and many of their combinations cannot be pressed in Hackintosh. This pretty much spoils the mood. Otherwise, all the operations described below can be successfully performed on Hackintosh.

Required knowledge

To program in general and for iOS in particular, you need to know quite a lot. Mathematics and logic may not be needed at first, but they will be in demand later. Modern technologies relieved the programmer of the need to thoroughly know the computer architecture, but it was necessary to understand basic mechanisms such as number systems, their conversion, the speed of subroutines or the efficiency of algorithms (big O).

For more high level An iOS developer needs to have a deep knowledge of the macOS operating system and iOS itself. You also need to master the Apple programming language. Knowledge of Delphi, C++, C# or VB.NET will not help you much. Apple has its own ecosystem with its own languages: Objective-C and Swift. Of course, knowledge of C++ has never harmed anyone; programs and inserts based on it are found everywhere, even at Apple. But the most used by definition is Objective-C, simply because it appeared much earlier (in the mid-eighties of the last century), while Swift only two years ago (in 2014). Apple has high hopes for new language and invests a lot in it. Objective-C is used to support the old software, and the new one is written in Swift. So it's good for you to know both.

In order not to waste time, all these programming languages ​​can be learned under the strict supervision of teachers on the website.

Development Tools

As you know, the main developer tool for macOS and with it iOS is the programming environment Xcode. It includes tools for creating applications for Mac, iPhone, iPad, Apple TV, Apple Watch. All Apple platforms. Xcode contains Interface Builder, a code editor that supports everything modern means working with code. In addition, without leaving Xcode, you can test the application; if it is developed for an external device, then it can be run in an emulator.

The system includes emulators of all devices, new versions of which can be downloaded. In addition, Xcode contains graphical tools for analyzing application performance, including tools for diagnosing CPU load, storage usage (HDD, SDD and others), load on the graphics adapter (from the OpenGL side).

On September 13, a new, hotly anticipated version of the development environment 8.0 was released. Stable versions can be downloaded for free from the App Store. Alphas and betas are distributed by developer subscription. The eighth version includes: a new version of the Swift 3 language, a learning tool for Swift Playground for iPad, a new version of Interface Builder, which has become faster and allows you to view the application layout on different platforms, without the need to deploy the application itself on the simulator.

With Xcode 8 you can develop applications for macOS Sierra, iOS 10, watchOS 3 and tvOS 10. All SDKs included. New versions of operating systems began to appear consistently right after Apple presentations, held in early September.

Objective-C language

Let us briefly recall the basic information about the language. Objective-C is a compiled object-oriented programming language used for writing applications for Apple systems. It is a superset or, in other words, an add-on to C, inheriting from the latter syntax, data types, methods of monitoring the progress of program execution and adding object-based capabilities to it oriented programming- description of classes and methods.

As in C++, in Objective-C the central role is played by objects, which are associated with four paradigms: abstraction, encapsulation, inheritance, polymorphism. C++ is a strongly typed language, while Objective-C is weakly typed or has a dynamic data type system. Like Smalltalk, Objective-C sends messages to objects. This is an exceptional opportunity dynamic languages, because the type of objects is checked at runtime, not at compile time.

The description of the Objective-C language takes up more than one voluminous volume. Therefore, in order to gain objective knowledge, it is convenient to take the “” course. An entire section of the course is dedicated to this language.

iOS application development

As a sample we will develop a very simple application. Let us not deviate from the sacred tradition, let us greet the world. However, taking into account the fact that we graphic application, we will diversify it a little: we will add a button, when clicked, we will display or hide the inscription “Hello, World”.

Launch Xcode, in the window that appears, select Create new project or in the main menu File -> New -> Project. The next window will ask you to select the target platform and application type.


In this case, we are interested in the iOS platform. There are seven types of applications to choose from. Six of them are templates for typical applications of the iOS operating system, containing a different set of components by default. The seventh type is play.

Application Types

  • The Single View Application template is intended for simple application with one screen. The preset includes a View Controller component, which allows you to customize the appearance of the application using the Interface Builder form designer.
  • Master Detail Application creates an application where table view a collection of objects is displayed. After selecting one of them, detailed information about that object is shown. The first view is the master, the second is the detailing.
  • Page-Based Application creates applications that have multiple screens, like pages in a book. Consequently, e-readers are created from this blank.
  • Tabbed application allows you to create applications where each screen can be switched to at any time, that is, each screen has its own button to activate it, on which the title is displayed. An example is iTunes.
  • Game is used to create a game template. There are four frameworks to choose from for creating a game: SpriteKit, SceneKit, OpenGL ES, Metal. Let's look at them briefly.
    SpriteKit is a system for 2D rendering and animation of textured rectangles - sprites. When displaying frames, a standard loop is used, the frame is displayed after all the contents of the scene have been processed.
    SceneKit is a high-level visualization framework 3D graphics without the help of OpenGL. It supports downloading, manipulation three-dimensional objects. It includes: a physics engine, a particle generator and an easy scripting method.
    OpenGL ES is the industry standard computer graphics. Allows you to visualize 2D and 3D scenes. Allows you to describe the pipeline for a video card: vertices undergo transformation, are assembled into primitives, which are rasterized into a two-dimensional image and displayed on the screen. Programmable shaders can be included in the pipeline.
    Metal is a low-level API that will allow you to get the most out of your video adapter. Debugged APIs along with precompiled shaders and multi-threading allow your game to rise to the top. new level productivity and quality.
  • Sticker Pack Application - the new kind apps introduced in iOS 10 and Xcode 8. It is a set of simple or animated images used in the new iMessage. It does not require coding to create it.
  • iMessage Application is a new type of application that appeared in iOS 10 and Xcode 8. Allows you to create add-ons for iMessage, for example to purchase and download your sticker pack. You can also use the iMessage API to create your own analogue this application, including playing audio, video, using stickers and more.

Creating the first project

As a template for our application, we will select Single View Application. Since we won't develop big program, the funds provided by this provision will be enough for us. Click Next. On next page The wizard must enter the name of the project, for example ShowLab. In the Language drop-down list, leave the default language selected - Objective-C. Next, in the Devices drop-down list, leave the Universal selection. Here you determine for which device (iPhone or iPad) the application is being created. The Universal clause means for both. Let's uncheck the Include Unit Tests and Include UI Tests boxes; we don't need any tests. Next. Select a folder to save the project. Now click the Create button.

As a result, a window will open with a list of all parameters applied to the project. In this window, you can change the parameters previously set in the wizard: orientation, target device, etc.


First we need to create the application interface. To do this, select the Main.storyboard file in the list on the left with one click (if this file is not visible, expand the contents of the ShowLab folder). To the right of the list, the entire window will be occupied by Interface Builder. The device layout will be displayed in the center. In the lower right corner of the window there is a component panel. Drag the Label and Button components from there onto the layout. Above the component panel is a list of properties. If you don’t have it, click the Show the Attributes Inspector button, located under the window title on the right side of the interface.

Select the Label component in the layout and configure its Text property: leave the Plain selection in the drop-down list, enter the desired inscription in the line below, in our case “Hello, World”. If the text does not fit within the borders of the label, change them by dragging the handles on the edges of the component. To centralize it horizontally, go to the Size Inspector page by clicking on the Show the Size Inspector button (to the right of Show the Attributes Inspector). On this page, from the Arrange drop-down list, select Center Horizontally in Container.

Now select the Button component, change its Text property to the desired label - Switch. You can center it in the same way as described above.

Creating a connection between graphic elements and code

IN Visual Studio(or Delphi) object in the code is created automatically the moment you place a visual component on the form. This doesn't happen in Xcode, but it doesn't cause problems.

Open the contents of the ViewController.h header file in separate window by double-clicking on it. This file contains a declaration of an extension of the UIViewController class, marked with the @interface keyword. This feature was added to the second version of Objective-C. Now do this trick: move the mouse cursor to a component - a text label, hold down Ctrl key And left button mice. Move the cursor to the window with the code (file ViewController.h), a blue line will follow the cursor. Release the mouse and key inside the ViewController interface description.

The Outlet creation window will appear.


This is a property of an object that refers to another object (in this case, a visual component). You need to enter the name of the Outlet object, by which you will access the visual component, let it be lab. Next, the object type is selected, it is selected correctly: UILabel.

Even lower in the Storage list, select the type of object reference: weak or strong. If you choose strong, then the object pointed to by the property will exist as long as the property points to it, in which case it will not be automatically deleted when it is no longer used. On the other hand, when a weak reference is in effect, the object can self-destruct. So, select the weak link type and click the Connect button. As a result, the following line will be added to the code:

@property (weak, nonatomic) IBOutlet UILabel *lab;

Let's make sure that Outlet is a property.

Now let's create an Outlet for the button. The algorithm remains the same. Only for the Name property you need to enter a different name, for example but. The line will be added to the code:

@property (weak, nonatomic) IBOutlet UIButton *but;

As a result, we have two pointers to visual components: lab and but - respectively, an inscription and a button. Now, using pointers, we can manipulate components in code.

Then you need to create a button click event handler. To do this, open the implementation file ViewController.m in a separate window. In exactly the same way as you dragged the line into the header file to create the outlet, from the button, drag the line into the implementation file and drop it to the closing command bracket - @end. A window for creating an event will appear, similar to the window for creating an outlet. You see the difference: a link to an object is created in the header file, a method is created in the implementation file.


Fill in the Name field, its value represents the name of the property - method. Let it be onClick. Leave the Type field value as default - id. In Objective-C this type is the ancestor of everyone else. In the Event drop-down list, the Touch Up Inside event is selected by default, which occurs when the pointer (mouse, finger...) is released over the button, that is, the final stage of pressing the button. That's what we need. In the Arguments list, we will leave the default value: Sender is the object that sent this signal, in our case it will always be a button. Click the Connect button. As a result, the following code will be added:

- (IBAction)onClick:(id)sender ( )

A minus at the beginning means private method(private). Keyword IBAction tags the events (methods) of visual components from Interface Builder.

Between the command brackets we will write the code that is executed when the button is pressed:

Lab.hidden = !_lab.hidden;

In this line of code we invert the value properties hidden. It is of type BOOL, which has two values: YES - true and NO - false (somewhat unusual for Windows programmers, where true and false).

Pay attention to the underscore character before the name of the object - the label (_lab). Without it, compilation will fail with an error. The underscore is added automatically for objects contained within other objects; that is, in this case, the lab object is contained in the ViewController object. Previously, this was a convention used to distinguish between objects declared as members of a class and local objects. And now this is a strict rule implemented in the language compiler.

Now you can compile the application and run it on the simulator. We chose the simulator for iPhone 7, included in Xcode 8. The compile and run button is a black rectangle and is located in the bar at the top of the interface.

After compiling the application, launching the simulator and loading our application, its interface will be displayed on the simulator screen: the inscription “Hello, World” and the Switch button. If you press the last one, the inscription will disappear; if you press it again, it will appear again.

We have made a very simple application to understand the essence of iOS development. You can learn more detailed information about creating iOS applications in Objective-C from the course by our friends from GeekBrains “”. The course devotes two months to learning this language. During the first month - introductory topics, and in the second - real coding of professional applications.

Swift language

IN 2014 year Apple introduced a new programming language - Swift. It quickly became the most talked about and fastest growing language in the world. It's reliable, safe, intuitive clear language for developing applications for the operating systems macOS, iOS, tvOS and watchOS for the entire fleet of Apple devices. Swift- effective language programming. It's easier to learn than its predecessor, Objective-C, and Swift borrows some of its best ideas. At the same time, the developers have made the languages ​​compatible, that is, one program can contain code in both Swift and Objective-C. There are billions of lines of code and hundreds of thousands of legacy programs written in Objective-C in the world, so its support will definitely not be abandoned.

At Swift development The goal was to create the most convenient system programming language - fast, safe and expressive.

The algorithm in Swift is 2.6 times faster than the same algorithm in Objective-C, and 8.4 times faster than in Python. Using Swift makes the program development process more flexible and convenient.

Thanks to its exponential development, December 3, 2015 Swift language has been contributed to the open source community. At the same time, Apple strictly monitors its development, organizing a committee for its development. Now Swift is available not only in Apple systems, but also on Linux. All additional tools for working with the language, including a debugger, standard library, manager package, also free and open.

This language is the future. You can find out more detailed information about it from the mentioned course from GeekBrains “”, in which a whole month is devoted to studying of this language programming.

App Store

Simply put, the App Store is a content store for the entire range of Apple devices. Here you can buy games and applications from both large companies and independent developers. Every developer, no matter what country he lives in, can sell or distribute his programs for free on this digital distribution platform. To start doing this, you need to register as a developer and buy a license to sell your applications. This is a fee for the service provided and development App store Store.

Results

We have developed a simple application for the iOS mobile operating system using the Xcode programming system along with the Objective-C language. Tested ready application on the iPhone 7 simulator. We learned how to build a user interface using Interface Builder, how to associate graphic elements with application code, and how to create event handlers. We got acquainted with the basics of Objective-C. In addition, we drew attention to promising language Swift, used to develop powerful and secure applications for the Apple ecosystem.

However, the material studied is only the beginning. In order to intensively upgrade yourself in the direction of mobile coding and the development of actually selling applications, we recommend taking the “” course on our friends’ website.

This is a worthy course: if you take it, you definitely won’t waste your time. It starts with two detailed courses on Java language, followed by learning basic programming for the Android mobile operating system. Next is a course on databases in general and the SQL language in particular. Then an in-depth course on developing professional Android applications. After this, the vector of study will move towards Apple systems: two detailed courses on the Objective-C language and a useful course on Swift.


The course lectures are taught by professional teachers with extensive experience in software development. If something is unclear, you can ask a question without delay. In general, learning on GeekBrains is a live process, you can communicate, ask questions, and help with answers. To test the acquired knowledge, teachers issue homework, which is then checked. After completing the training, you will have a guaranteed internship in an IT company. And then everything depends on you, if you show yourself as a competent specialist, you will be invited to work.

Special project with the company

Best articles on the topic