Download presentation
Presentation is loading. Please wait.
Published byAbel Booth Modified over 6 years ago
1
Views in iOS Mobile apps for iPhone & iPad Telerik Software Academy
2
Table of Contents Views Creating custom views Drawing on a view
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
UITableViewCell and UIView
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
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
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.