ScholarQuill logoScholarQuillUniversity Notes
My Semester
Explore Notes
Past Papers12 New
Video CoursesNew
Search
Settings
Study Tools
GPA/CGPA Calculator
Schedule & To-Do
Student Portal
Contact
Contact
ScholarQuill logo
My Semester
Explore Notes
Past Papers12 New
Video CoursesNew
Search
Settings
GPA/CGPA Calculator
Schedule & To-Do
Student Portal
Contact
ScholarQuill logoScholarQuillUniversity Notes
Study PortalCOMP4126Master Detail Drilldow…
Ctrl + K
Login
Explore
Search
Semester
Papers
CGPA
    COMP4126

    Mobile Application Development 2

    Progress0 / 38 done
    Topics38
    1Understanding Xcode2Using the Xcode interface builder and objects library3Understanding view hierarchy and creating a custom app icon
    4Understanding outlets and actions5Using text fields, buttons, labels, web views, and page controllers6Using views with subviews and creating views using code
    7Working with the single view template8Exploring the app delegate and adding new view controllers9Transitioning between multiple view controllers using animations
    10Tabbar and master detail templates
    11Customizing for different inputs12Adjusting text field behaviors and dismissing the keyboard13Detecting keyboard activities with notification center14Using scroll view and responding to keyboard activities programmatically
    15Detecting device hardware16Dynamically adjusting graphical layouts and creating universal apps
    17Understanding UITableView and UITableViewCell18Working with UITableView data source and delegate19Master detail template, drill-down menus, and navigation20Using property lists for data persistence and creating multi-section tables
    21Portrait and landscape modes22Handling device rotation and forcing specific orientation23Dynamically adjusting layouts based on rotation
    24Importing sqlite3 and creating a database25Writing tables, inserting records, and bundling a database with your app26Checking for database existence and reading/displaying data
    27NSTimer class and object transformations28Rotation, scaling, translation, animating image arrays, and playing video
    29Email, Safari, and SMS30Working with camera and photo library
    31Consuming and parsing XML and JSON32Integrating Twitter and Facebook with iOS apps
    33MapKit and MKMapView34Getting and displaying user location and directional information35Displaying map annotations, disclosure buttons, and reverse geocoding36Working with iCloud
    37Gyroscope and accelerometer38Outputting sensor data and using the Shake API
    3 min read
    Topic 19 of 38
    Topic Study Note Illustration
    19

    Master detail template, drill-down menus, and navigation

    A Master–Detail app is a common iOS design pattern where:

    📱 Master–Detail Template, Drill-Down Menus & Navigation (iOS – Xcode)


    ✅ 1. Definition

    🔹 Master–Detail Template

    A Master–Detail app is a common iOS design pattern where:

    • Master View → shows a list of items
    • Detail View → shows full information about the selected item

    👉 Example:

    • Email app (Inbox → Email content)
    • Contacts app (List → Contact details)

    🔹 Drill-Down Menu

    A drill-down menu is a navigation style where the user:

    • Starts from a list (main screen)
    • Taps an item
    • Moves deeper into another screen with more details

    👉 It creates a hierarchical navigation flow


    🔹 Navigation

    Navigation is the process of moving between different screens (View Controllers) using:

    • Navigation Controller
    • Segues
    • Push / Pop transitions

    🧠 2. Key Concepts

    🔹 UINavigationController

    • Manages a stack of view controllers
    • Controls navigation flow

    🔹 Navigation Stack

    Stack (abstract data type)
    Visual ReferenceStack (Abstract Data Type)
    Wikipedia
    • First screen = root view controller
    • New screens are pushed on top
    Root → Screen 1 → Screen 2 → Screen 3
    

    🔹 Push & Pop

    Action Meaning
    Push Move to next screen
    Pop Go back to previous screen

    🏗️ 3. Master–Detail Structure

    Master View (List)
            ↓
       User selects item
            ↓
    Detail View (Information)
    

    ⚙️ 4. How Master–Detail Works


    🔹 Step 1: Master View (Table View)

    • Displays list of items
    • Uses UITableView
    let items = ["iPhone", "iPad", "MacBook"]
    

    🔹 Step 2: Select Item

    func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
        let selectedItem = items[indexPath.row]
    }
    

    🔹 Step 3: Navigate to Detail View

    Using Storyboard Segue:

    • Control + Drag → “Show (Push)”

    OR programmatically:

    let vc = storyboard?.instantiateViewController(withIdentifier: "DetailVC") as! DetailViewController
    vc.selectedItem = items[indexPath.row]
    navigationController?.pushViewController(vc, animated: true)
    

    🔹 Step 4: Display Detail Data

    override func viewDidLoad() {
        super.viewDidLoad()
        
        detailLabel.text = selectedItem
    }
    

    🔄 5. Drill-Down Navigation Flow

    List Screen
       ↓ tap
    Category Screen
       ↓ tap
    Detail Screen
    

    👉 Each selection goes deeper into the app structure.


    📊 6. Diagram Description (for Exams)

    Draw:

    Master (List)
        ↓
    Detail (Info)
        ↓
    More Detail (Optional Drill Down)
    

    OR Navigation Stack:

    Root → Screen 1 → Screen 2 → Screen 3
    

    🧭 7. Navigation Methods in iOS


    🔹 1. Push Navigation

    navigationController?.pushViewController(vc, animated: true)
    

    🔹 2. Pop Navigation

    navigationController?.popViewController(animated: true)
    

    🔹 3. Pop to Root

    navigationController?.popToRootViewController(animated: true)
    

    💡 8. Example App

    🎯 Product App

    • Master: Product list
    • Detail: Product information

    Flow:

    1. User selects “iPhone”
    2. Moves to detail screen
    3. Shows specs, price, description

    📌 9. Important Rules / Tips

    • Always embed in Navigation Controller
    • Use segues or push navigation
    • Pass data before navigating
    • Maintain clean hierarchy
    • Use drill-down only for related screens

    ⚠️ 10. Common Mistakes

    • ❌ Not using Navigation Controller
    • ❌ Forgetting to pass data to detail view
    • ❌ Wrong storyboard identifiers
    • ❌ Losing navigation stack
    • ❌ Overcomplicated navigation flow

    🧠 11. Best Practices

    • Keep master list simple
    • Use clear navigation hierarchy
    • Pass only necessary data
    • Use reusable view controllers
    • Maintain consistent UI flow

    📝 12. Likely Exam Questions

    1. What is a Master–Detail application?
    2. Explain drill-down navigation.
    3. What is UINavigationController?
    4. Differentiate push and pop navigation.
    5. How do you pass data between view controllers?
    6. Explain navigation stack with diagram.
    7. Write code to navigate to detail screen.
    8. What is the use of Master view in iOS apps?

    📚 13. Quick Revision Summary

    • Master View → list of items

    • Detail View → selected item info

    • Drill-down → step-by-step deeper navigation

    • Uses:

      • Navigation Controller
      • Push / Pop methods
    • Navigation stack manages screens

    • Very common in:

      • Settings apps
      • Email apps
      • Product catalogs

    ← Previous topic 18
    Working with UITableView data source and delegate
    Next topic 20 →
    Using property lists for data persistence and creating multi-section tables

    Past Papers

    Open this section to view and download past papers

    Click on Show Past Papers to load available exam papers.

    Reading Progress
    0%
    3mremaining
    591words
    Beginnerlevel
    On This Page

    No headings found

    Study Toolkit

    Subject Portal

    Mobile Application Development 2