ScholarQuill logoScholarQuillUniversity Notes
  • Notes
  • Past Papers
  • Blogs
  • Todo
Login
ScholarQuill logoScholarQuillUniversity Notes
Login
NotesPast PapersBlogsTodo
More
SubjectsDiscussionCGPA CalculatorGPA CalculatorStudent PortalCourse Outline
About
About usPrivacy PolicyReportContact
Notes
Past Papers
Blogs
Todo
Analytics
    Current Subject
    🧩
    Mobile Application Development 2
    COMP4126
    Progress0 / 38 topics
    Topics
    1. Creating an iOS App: Understanding Xcode2. Using the Xcode interface builder and objects library3. Understanding view hierarchy and creating a custom app icon4. Outlets, Actions, and Views: Understanding outlets and actions5. Using text fields, buttons, labels, web views, and page controllers6. Using views with subviews and creating views using code7. Using View Controllers: Working with the single view template8. Exploring the app delegate and adding new view controllers9. Transitioning between multiple view controllers using animations10. Application Templates: Tabbar and master detail templates11. The iOS Keyboard: Customizing for different inputs12. Adjusting text field behaviors and dismissing the keyboard13. Detecting keyboard activities with notification center14. Using scroll view and responding to keyboard activities programmatically15. Working with Different iOS Devices (iPhone & iPad): Detecting device hardware16. Dynamically adjusting graphical layouts and creating universal apps17. Using Table Views: Understanding UITableView and UITableViewCell18. Working with UITableView data source and delegate19. Master detail template, drill-down menus, and navigation20. Using property lists for data persistence and creating multi-section tables21. Supporting Screen Rotations: Portrait and landscape modes22. Handling device rotation and forcing specific orientation23. Dynamically adjusting layouts based on rotation24. Working with Databases: Importing sqlite3 and creating a database25. Writing tables, inserting records, and bundling a database with your app26. Checking for database existence and reading/displaying data27. Using Animations & Video: NSTimer class and object transformations28. Rotation, scaling, translation, animating image arrays, and playing video29. Accessing Integrated iOS Apps: Email, Safari, and SMS30. Working with camera and photo library31. Using Web Services: Consuming and parsing XML and JSON32. Integrating Twitter and Facebook with iOS apps33. Working with iOS Maps and Location Services: MapKit and MKMapView34. Getting and displaying user location and directional information35. Displaying map annotations, disclosure buttons, and reverse geocoding36. Working with iCloud37. Working with the Accelerometer: Gyroscope and accelerometer38. Outputting sensor data and using the Shake API
    COMP4126›Master detail template, drill-down menus, and navigation
    Mobile Application Development 2Topic 19 of 38

    Master detail template, drill-down menus, and navigation

    3 minread
    584words
    Beginnerlevel

    📱 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

    • 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 load past papers

    Click on Show Past Papers to see past papers.
    On This Page
      Reading Stats
      Est. reading time3 min
      Word count584
      Code examples0
      DifficultyBeginner