1 / 14

Views in iOS

Views in iOS. Telerik Software Academy. http://academy.telerik.com. Mobile apps for iPhone & iPad. Table of Contents. Views Overview Nib/ Xib files Loading Nib files Creating custom views Creating a custom reusable UITableViewCell Creating a custom UIView Drawing on a view. Views.

Download Presentation

Views in iOS

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Views in iOS Telerik Software Academy http://academy.telerik.com Mobile appsfor iPhone & iPad

  2. Table of Contents • Views • Overview • Nib/Xib files • Loading Nib files • Creating custom views • Creating a custom reusable UITableViewCell • Creating a custom UIView • Drawing on a view

  3. Views Overview

  4. Views Overview • Views are part of the MVC architecture • They represent the UI of an iOS application • Built from NIB files and Obj-C/Swift classes • NIB/XIB files are files with only UI • NExTSTEP Interface Builder • They have no code, only UI • NIB files can be loaded dynamically • As a resource

  5. Views Hierarchy • Views build an hierarchy of views • The outer/root view is the window • The window contains a storyboard scene • Scenes can contain other views • Views can contain views • Etc…. • When the windows is rendered it sends message to its subviews to render as well • As do they to their subviews and so on…

  6. Creating and Loading NIB Files Live Demo

  7. Creating Custom Views UITableViewCell and UIView

  8. Creating Custom Views • Views can be created by a NIB file and a class that inherits UIView • Or a subclass of UIView • The NIB file and the class are connected the same way as a storyboard scene and a ViewController • Select the View in Interface builder • Open the Utilities toolbox • Go to Identity inspector • Set the class

  9. Linking NIB file and a UIView subclass Live Demo

  10. Creating a Reusable UITableViewCell Live Demo

  11. Creating a Custom View Live Demo

  12. Creating View with Drawings Live Demo

  13. Views in iOS http://academy.telerik.com

  14. Homework • Create a table view cell containing an image and a title • Use it inside a UITableViewController • Create a custom view for representing tabs • Each tab has a title and content • The content is visible only if the tab is selected • Only a single tab can be selected at a time • The content can contain any number of UIViews

More Related