Easy programming: create your first app for iPhone. Part 2. | Irina Galkina | Skillshare

Easy programming: create your first app for iPhone. Part 2.

Irina Galkina, Easy programming.

Play Speed
  • 0.5x
  • 1x (Normal)
  • 1.25x
  • 1.5x
  • 2x
8 Lessons (15m)
    • 1. intro

    • 2. Cats and classes

    • 3. Reflex buttons into the source code

    • 4. Method for the buttons

    • 5. First start

    • 6. Arrays

    • 7. Method highlighting

    • 8. Update highlighting for buttons


About This Class

We will create simple and useful application for iOS - Egg Timer.


We will start from setting up development environment and go to the completed application.

In this class you'll learn:

  • how to set up development environment(download Xcode and start your first project);
  • how to quick and simple add different controllers (buttons, labels, sliders etc.) to your app's screens;
  • basic structure of the iOS application;
  • what is the storyboard and how to use it;
  • the basics of construction of the source code;
  • how to connect controllers form the storyboard with source code;
  • how to add and use timers in your apps;

In the Part 2 we will do:

  • connection source code to the storyboard;
  • highlighting of the buttons;
  • construction for saving current state of the screen.


And also we will learn something new about cats)



1. intro: Hello. My name is Serena, and I'm hours developer. Use so many gaps in our everyday life and now extend to create your own up in this class. It'll create simple and useful application. Tyler, we will. You received as a problem in language. If you don't have any problem and experience, no matter, no special knowledge is needed. I will show you how to start from downloaded exclude from iTunes to the completed application. In the end of this class, you have cool up and on the base off, you can create your own timer, which you can use in your everyday life. Like a speck, a two timer or physical activity. Steiner momentarily want 2. Cats and classes: hello to everyone in the second part off this class. And now it's time to connect our screen toe our source code. And first of all, I want to make a short introduction How it works. So imagine that you have a cat and you want to reflects. You can't in the star, Scott and how it will look like just if all we can say that get has some kind of properties like color, age name and it it has eyes, legs and something. And also it has something that it could do. Maybe it had play. It can play. Oh, maybe you can stroke it so we can describe that. But not with announce like, um, like, name off on names like Eric it and maybe, ah, how many legs head and has and reserve herbs what it can do and what could be done visit and to reflect in the program in class, we can imagine we can reflect it in the properties like Name H and methods. Methods is like a rope like you can stroke it. Oh, maybe you can play with it so that zits how it works in programming 3. Reflex buttons into the source code: So now we have our off you our screen and we want to reflect Our star scored We will reflected in our view Controller sniffed file Why? If I choose my only one You controller Only one screen and go are to this menu I will see. Is that here? I have you controller. As you can see, it's the same with the name off this you controller So the reflection off my screen is this you control? How can it affects it? Festive fall I should go. I should go in autumn in a system that deter by pressing this button And I just choose my bottom and breast control And I started drug it in my source file the service Good. That's all here. I just want to type name off my button here So it will be like soft both bottom and I will do the same. So it's our kids, our view controller Fire! It's a reflection off our screen, Andi, As the inflation is a reflection off what has our view? Controller? Our screen. It has two parts and through liable and in the reflection in you control the cast will have the same three buttons. So I will do the same for each bottom 4. Method for the buttons: Yeah. And also, I want to add to my reflection toe my view. Controller class, uh, methods. Verbs. So what will happen when I press my some? Well, bottom on a posh bottom or hard boiled bottom? So I want the same just ah, press control and drug it in my you controller class. But I will choose connection, not outlet, but action actually mean method. That will happen. What? When I press this button and I just type Chris and do the same, it was all my buttons action. 5. First start: now I just can go back to standard in deter and go to my view controller. So the main work starts. And first of all, I want todo set something for my bottoms here, and I will send in my view download method with med. It is downloading Ziff, you setting kid, and it looks like you want so in admitted I want to set to my buttons is highlighted, and one not so one b will be like selected active, but others will be like not selected. So here I want my 1st 2 button, like for some world and in a bash button will be highlighted and certain will not. So I just, uh, type so bold button. Choose my point and type. It's highlighted and just to and else. So I will just in a But, um is highlighted and I just wrong. So I will have some think legs. It's so my 1st 2 button will not be selected, but the 3rd 1 will miss Select it. So what you say consider it's small. It's like like we chose hard world 6. Arrays: So what I want to do now I want that if I choose one of the bottom and that was the one who will be highlighted. So I want on the one button to be selected for this. I want to add to my class one more property. Uh, like, uh, array. His name's selected type with bullion values and decides will be three are here iss A little demonstration. What does the ray all right? Is there, like, amount off values with the sometime we will use time willen, which can be only true off falls and each element in the array has it old index like from zero toe to our case. But maybe toe in as number and we can take the is something from the array by this index. So by this line were created Such array discount this number off filament three in each off elements. Bullen emits enemy and has it very like false 7. Method highlighting: and what I want a safe in this area. I want to say states for my buttons. So if the value within zero will be true, that means that the button with index zero for me it's a softball button shouldn't be collected. There is little misunderstanding with highlighting, So as you can see, highlighted bottom looks like a little bit little bit shadowed like no highlight it. So, uh, in this case, we use Highlight that in this from in this mean eso highlighted means a little bill dark like a not selected are like this one. So this is But in this highlight. And for this we will create one more method. One more functions like some think like Europe. What can be done with my view controller with my screen and his name Sit. Why, huh? In for Modern said, highlighting for moderns And what will happen here? Here I will just go through my hurry goes through with always in Texas and in my Celexa Stipe Williams Index zero is true. That means that our softball buddy is highlighted Should be false should be like a bright In the other case, it should be true and I want to do the same with all my buttons. So for the in a bash button in the valley was Index one. So here I change to name in a push button should be false. If select the type with index, I will be true and the same with the Hard World button with index to. So here we just update the state off our buttons, and I prefer it would be here toe closer, toe all other buttons, but does this medicine from being broke from somewhere and the logical to be invoked from this message where ah, hard boiled bottom prayers or in a port button pressed or some bull but impressed. 8. Update highlighting for buttons: And now here is in our midterms in our verbs. We want to set some things that will change when are what, Miss Breast for first off, all I want to change my logical state. Oh, for hard world bottom psychological state for well reasoned X two should be true because it should not should be highlighted should be bright but for the other speech will be forced because they should be highlighted. They should be a little bit shadow so false and when other bargains is oppressed should be the same but with different values for value is indexed ocean before but for well, you is in expansion the truth and when so but breasts the reflection off the sell button Well, with index zero should be true value within 20 and as I should be force. But it will not change anything because we didn't change something that connected to our buttons. Our bottles is here is a reflection off. Our buttons are from our screens, so we should change something with objects. But we already done in the methods. So we just should invoke it from the actions. And now we can start our application on the simulator and we will see that everything changed and works fine. I hope so. Yes. And else up to be a logical clear. I said select the type for value was indexed True because we said our hard world button should be not highlighted for the first time.