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›Understanding view hierarchy and creating a custom app icon
    Mobile Application Development 2Topic 3 of 38

    Understanding view hierarchy and creating a custom app icon

    4 minread
    604words
    Beginnerlevel

    📱 Understanding View Hierarchy & Creating a Custom App Icon (iOS – Xcode)


    🧩 PART 1: Understanding View Hierarchy

    ✅ 1. Definition

    View Hierarchy is the arrangement of UI elements (views) in a parent–child structure in an iOS app. Each screen is made of multiple views organized in layers, where one view can contain other views.


    🧠 2. Key Concepts

    🔹 View

    • A rectangular area on screen (e.g., button, label, image)

    🔹 Superview

    • The parent view that contains other views

    🔹 Subview

    • A child view inside another view

    🔹 Root View

    • The main view of a screen, controlled by a View Controller

    🏗️ 3. Structure of View Hierarchy

    Example:

    Main View (Root View)
    │
    ├── Label
    ├── Button
    └── Image View
    

    👉 Here:

    • Main View = Superview
    • Label, Button, Image = Subviews

    📊 4. Diagram Description (for Exams)

    Draw a tree structure:

    • Top: Root View

    • Branches:

      • Label
      • Button
      • Image View Show arrows from parent to child.

    ⚙️ 5. How View Hierarchy Works in Xcode

    Step 1: Open Storyboard

    • Open Main.storyboard

    Step 2: Use Document Outline

    • Located on the left side
    • Displays hierarchical structure of views

    Step 3: Add UI Elements

    • Drag elements from Objects Library

    Step 4: Arrange Views

    • Drag elements in outline to change hierarchy

    Step 5: Manage Layering

    • Top views overlap lower ones
    • Order affects visibility

    📌 6. Important Rules

    • A subview cannot exist without a superview
    • Position is relative to its parent view
    • Hidden parent → all child views hidden
    • Use hierarchy for better UI organization

    💡 7. Example

    Login Screen Hierarchy:

    View
    │
    ├── Logo Image
    ├── Username TextField
    ├── Password TextField
    └── Login Button
    

    🎨 PART 2: Creating a Custom App Icon


    ✅ 1. Definition

    An App Icon is the small image that represents an app on the home screen of an iPhone or iPad.


    🧠 2. Key Concepts

    🔹 AppIcon Asset

    • A set of images in different sizes stored in Xcode

    🔹 Asset Catalog

    • Folder in Xcode (Assets.xcassets) where images and icons are stored

    🔹 Required Sizes

    Different devices require different icon sizes:

    • 20x20
    • 29x29
    • 40x40
    • 60x60
    • 1024x1024 (App Store)

    ⚙️ 3. Steps to Create a Custom App Icon

    Step 1: Design Icon

    • Use tools like:

      • Figma
      • Photoshop
    • Keep design:

      • Simple
      • Clear
      • No text (recommended)

    Step 2: Generate Icon Sizes

    • Use online tools or export multiple sizes manually

    Step 3: Open Asset Catalog

    • In Xcode → Open Assets.xcassets
    • Click AppIcon

    Step 4: Add Icons

    • Drag and drop images into correct size slots

    Step 5: Set App Icon

    • Xcode automatically uses AppIcon set

    Step 6: Run App

    • Icon appears in simulator/home screen

    📊 4. Diagram Description (for Exams)

    Draw:

    • Grid of icon placeholders (AppIcon slots)
    • Label different sizes like 60x60, 1024x1024

    📌 5. Important Rules / Tips

    • Use PNG format
    • Do NOT add transparency (for App Store icon)
    • Maintain consistent design across sizes
    • Follow Apple Human Interface Guidelines
    • Use high resolution (1024×1024)

    💡 6. Example

    Simple App Icon Idea:

    • Blue background
    • White chat bubble icon
    • Clean and minimal design

    📝 7. Likely Exam Questions

    1. Define view hierarchy in iOS.
    2. Differentiate between superview and subview.
    3. Explain how view hierarchy is managed in Xcode.
    4. Draw and explain a view hierarchy diagram.
    5. What is an app icon?
    6. Explain steps to create a custom app icon in Xcode.
    7. What is Asset Catalog?
    8. Why are multiple icon sizes required?
    9. Write rules for designing a good app icon.

    📚 8. Quick Revision Summary

    🔹 View Hierarchy

    • Parent-child structure of UI elements
    • Root View → Superview → Subviews
    • Managed using Document Outline
    • Controls layout and visibility

    🔹 App Icon

    • Represents app on device
    • Stored in Assets.xcassets
    • Requires multiple sizes
    • Must be simple, clear, high-quality

    Previous topic 2
    Using the Xcode interface builder and objects library
    Next topic 4
    Outlets, Actions, and Views: Understanding outlets and actions

    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 time4 min
      Word count604
      Code examples0
      DifficultyBeginner