Download presentation
Presentation is loading. Please wait.
1
Telerik Software Academy http://academy.telerik.com Mobile apps for iPhone & iPad
2
iOS app architecture ViewControllers Views Linking Views to ViewControllers Adding and Using Controls
3
Templates and Stuff
4
iOS apps are build from two components: Views – represent the UI ViewControllers – the programming logic Views are linked to ViewControllers ViewControllers are regular classes They can fetch data from the views They can send data to the views They can change the views programatically
5
Views and Controls
6
Views are represented by a XIB (NIB) files They hold the UI components Can contain UI logic Is built from controls When creating an iOS app, a initial view is created Depending on the project type it can be empty or with a scaffold application
7
To add controls to a View: Open a storyboard file (Main.storyboard) Show the Utilities Drag a control from the toolbox into the view
8
Live Demo
9
UIViewController and UITableViewController
10
ViewControllers are the code-behind of a View They are linked to a View Can react to events from a View (button click, text change, etc…) Can send data to a View Change the content of a text field, take the selected date from a DatePicker, etc… Can change a View Create animations or replace views
11
There are many types of ViewControllers UIViewCotroller, UITableViewController, UISplitViewController, etc.. UIViewController and UITableViewController are used the most UIViewController is a generic ViewController Nothing special about it UiTableViewController is used for a table view Used to list data
12
To create a UIViewController: Create a regular class and inherit UIViewController Select a view from a storyboard In the Utilities Show Identity Inspector Type the name of your UIViewController into the class text field Done, can link controls
13
Live Demo
14
UITableViewController is done pretty much the same as UIViewController Inherit UITableViewController, instead of UIViewController UITableViewController needs a little setup Create a Table View to the storyboard Add a table view cell to the table view Give it an identifier Write two methods in your TableViewController -tableView:cellForRowAtIndexPath-tableView:numberOfRowsInSection
15
Live Demo
17
To link (use) controls in the ViewController, IBOutlets must be created Go to the Storyboard CTRL + click on the control Select "New Referencing Outlet" and drag it to the ViewController A property is created so the control can be used in the ViewController
18
Live Demo
19
With a IBOutlet, a control can be used in the ViewController Yet actions are hard to be handled We can link an event from a control from the View to a method in the ViewController CTRL + click on the control Select a event (i.e. "Touch up inside") and drag it to the linked ViewController
20
Live Demo
21
форум програмиране, форум уеб дизайн курсове и уроци по програмиране, уеб дизайн – безплатно програмиране за деца – безплатни курсове и уроци безплатен SEO курс - оптимизация за търсачки уроци по уеб дизайн, HTML, CSS, JavaScript, Photoshop уроци по програмиране и уеб дизайн за ученици ASP.NET MVC курс – HTML, SQL, C#,.NET, ASP.NET MVC безплатен курс "Разработка на софтуер в cloud среда" BG Coder - онлайн състезателна система - online judge курсове и уроци по програмиране, книги – безплатно от Наков безплатен курс "Качествен програмен код" алго академия – състезателно програмиране, състезания ASP.NET курс - уеб програмиране, бази данни, C#,.NET, ASP.NET курсове и уроци по програмиране – Телерик академия курс мобилни приложения с iPhone, Android, WP7, PhoneGap free C# book, безплатна книга C#, книга Java, книга C# Николай Костов - блог за програмиране http://academy.telerik.com
22
Create a UITableViewController that holds a list of generated and encoded passwords Each password has an account name and encryption code Once you type the code, the encrypted password is decrypted Implement a UIViewController for adding a password, encryption code and an option to create a random password
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.