8/28/2023 0 Comments Xcode 12 single view appViewController is the class that manages the view so naturally, it’s going to be the place we add the code to handle the button click. You can also take this opportunity to widen your UIButton and UILabel elements a little bit by adjusting it in Interface Builder.Įxposing UIElements to the ViewController Since we’re going to make the button change the text of the label, let’s add the text “Switch Text” to our button. Let’s put some text on this button through the property inspector on the right hand side. You should end up with a view with a label, textfield and button. Next, repeat the same steps but this time, search for “UIButton” and drag and drop that element onto your view. Next, repeat the same steps but this time, search for “UITextField” and drag and drop that element onto your view. ![]() Search for “UILabel” in the Library pane in the lower right hand corner and drag the UILabel onto your view. We’re going to add a UILabel to the view just like in our Hello World demo. The editor area is going to change to Interface Builder. If you’re using XCode 4, your storyboard file may be named differently. Let’s start with adding a UILabel, UITextField and UIbutton to our view!įirst let’s go into Interface Builder to edit Main.storyboard. If you forgot how to do this, please refer to the tutorial on creating your first XCode project. We’re going to start a brand new single-view project. I highly recommend that you follow along on your own computer to get the most out of these lessons. In this tutorial, we’re going to explore some additional UIElements and how to handle user interaction! In order to benefit the most from these lessons, you should open XCode and try to follow along. This means lots of hands on work and practice! We’re taking a practical approach to learning iOS programming.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |