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›Transitioning between multiple view controllers using animations
    Mobile Application Development 2Topic 9 of 38

    Transitioning between multiple view controllers using animations

    3 minread
    458words
    Beginnerlevel

    📱 Transitioning Between Multiple View Controllers Using Animations (iOS – Xcode)


    ✅ 1. Definition

    Transitioning between view controllers means moving from one screen to another in an app. When animations are added, the transition becomes visually smooth and engaging (e.g., slide, fade, flip).


    🧠 2. Key Concepts

    🔹 View Controller Transition

    • Switching from one View Controller to another

    • Can be:

      • Push (Navigation-based)
      • Modal (Present/Dismiss)

    🔹 Animation

    • Visual effect during transition
    • Improves user experience (UX)

    🔹 Transition Styles

    Common animation styles:

    • Slide (default)
    • Fade
    • Flip
    • Cross dissolve
    • Custom animation

    🏗️ 3. Types of Transitions


    🔹 1. Push Transition (Navigation Controller)

    • Used in apps with navigation stack
    • New screen slides in from right
    navigationController?.pushViewController(secondVC, animated: true)
    

    🔹 2. Modal Transition (Present)

    • Presents a new screen on top
    present(secondVC, animated: true, completion: nil)
    

    🔹 3. Dismiss Transition

    dismiss(animated: true, completion: nil)
    

    🎬 4. Built-in Animation Styles

    You can customize modal transitions:

    secondVC.modalTransitionStyle = .flipHorizontal
    present(secondVC, animated: true)
    

    📌 Common Styles

    Style Description
    .coverVertical Slide up (default)
    .flipHorizontal Flip animation
    .crossDissolve Fade effect
    .partialCurl Page curl

    ⚙️ 5. Using Storyboard Segues with Animation


    🔹 Step 1: Add Segue

    • Control + Drag → connect two view controllers

    🔹 Step 2: Select Segue Type

    • Show (Push)
    • Present Modally

    🔹 Step 3: Configure Animation

    • Select destination VC
    • Set Transition Style in Attributes Inspector

    🎨 6. Custom Animations (Advanced)

    You can create your own animation:

    UIView.transition(with: self.view, duration: 0.5, options: .transitionFlipFromRight, animations: {
        self.present(secondVC, animated: false)
    })
    

    📊 Diagram Description (for Exams)

    Draw:

    Screen 1 ──(Animated Transition)──▶ Screen 2
         (Slide / Fade / Flip)
    

    📌 7. Important Rules / Tips

    • Use animations to improve UX, not distract
    • Keep transitions fast and smooth
    • Use Navigation Controller for structured flow
    • Avoid too many complex animations
    • Maintain consistency across app

    💡 8. Example

    🎯 Animated Navigation App

    Screen 1:

    • Button → “Next”

    Code:

    @IBAction func goNext(_ sender: UIButton) {
        let vc = storyboard?.instantiateViewController(withIdentifier: "SecondVC") as! SecondViewController
        vc.modalTransitionStyle = .crossDissolve
        present(vc, animated: true)
    }
    

    👉 Result:

    • Screen fades into next screen

    ⚠️ 9. Common Mistakes

    • ❌ Not embedding in Navigation Controller
    • ❌ Forgetting Storyboard ID
    • ❌ Using too slow animations
    • ❌ Mixing inconsistent styles

    📝 10. Likely Exam Questions

    1. What is view controller transition?
    2. Explain push and modal transitions.
    3. List different animation styles in iOS.
    4. How do you present a view controller with animation?
    5. Write code for flip animation transition.
    6. What is the role of Navigation Controller?
    7. Explain custom animation in iOS.
    8. Draw a diagram of animated transition.

    📚 11. Quick Revision Summary

    • Transition = moving between screens

    • Types:

      • Push (navigation stack)
      • Modal (present/dismiss)
    • Animations:

      • Slide, Fade, Flip
    • Use:

      • present()
      • pushViewController()
    • Customize with:

      • modalTransitionStyle
    • Keep animations smooth and consistent


    Previous topic 8
    Exploring the app delegate and adding new view controllers
    Next topic 10
    Application Templates: Tabbar and master detail templates

    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 count458
      Code examples0
      DifficultyBeginner