티스토리 뷰
안녕하세요 Diana 입니다.
앨범의 첫 화면을 마치고 오늘은 앨범에서 썸네일을 눌렀을 때 자세한 이미지 화면으로 이동하는 애니메이션을 구현해보려고 합니다.
처음 iOS 개발을 시작했을때는 Modal의 기본 화면전환과 NavigationController 등을 사용한 화면전환을 많이 사용했었는데 실무에 들어가니 자연스러운 전환을 위해 애니메이션이 사용된다는 것을 알게 되었습니다.
애니메이션을 통한 화면 이동은 처음엔 굉장히 이해도 어렵고 이해를 했어도 구현까지 막막했었기 때문에 혹시라도 저와 같이 고생을 하고 있으신 분들을 위해 정리를 해보려고 합니다.
오늘은 구현을 위한 개념을 정리하고 다음 포스팅에서 실제 구현이 이루어질 예정입니다.
시작하겠습니다~
✅ 알아야 할 개념
UITransitioningDelegate를 사용한 화면전환 애니메이션을 구현하기 위해서는 TransitioningDelegate, Transitioning Animation 그리고 Custom Presentation 이라는 세 가지 개념을 반드시 알아야 합니다.
각각의 개념 안에 세부 개념도 존재하긴 하지만 우선 큼직큼직한 개념들부터 정리해보도록 하겠습니다.
✅ TransitioningDelegate
공식문서에 따르면 Transitioning Delegate는 Transition animation과 Custom Presentation의 시작점이라고 합니다.
Custom Presentation을 실행하기 위해서는 해당 Transition Delete를 이동하고자 하는 ViewController에 설정해줘야 하며 설정하지 않는다면 우리가 평소에 보는 아래에서 위로 올라오는 기본 Transition을 확인할 수 있습니다.
그럼 Transitioning Delegate를 구현하기 위해서는 어떤 개념을 알아야 할까요?
공식문서에 따르면 Transitioning Delegate를 구현하기 위해서는 UIViewControllerTransitioningDelegate 프로토콜을 만족시켜야하며 Transitioning Delegate는 Animator Object, Interactive Animator Object 그리고 Presentation Controller를 UIKit에 제공합니다.
즉, UIViewControllerTransitioningDelegate를 만족시키는 타입 내부에서 Animator Object, Interactive Animator Object 그리고 Presentation Controller 객체를 가지고 애니메이션을 진행합니다.

☑️ Animator Objects 란?
Animator Objects는 ViewController의 View를 Reveal 또는 Hide 하는데 사용되는 Animation을 만드는 역할을 합니다.
Transitioning Delegate는 Reveal 할때와 Dismiss 할때 각각 다른 Animator을 적용하도록 설정할 수 있습니다.
이런 Animator 객체들은 UIViewControllerAnimatedTransitioning 프로토콜을 만족시킵니다.
Transitioning Delegate는 실제 화면전환 시 애니메이션이 이루어지는 곳 입니다.
자세한 내용은 다음 포스팅에서 다루도록 하겠습니다.
☑️ Interactive Animator Objects 란?
Interactive animator 객체는 touch event와 gesture recognizer를 사용하는 커스텀 애니메이션의 타이밍을 조절합니다.
Interactive animator 객체는 UIViewControllerInteractiveTransitioining 프로토콜을 만족시킵니다.
☑️ Presentation Controller 란?
Presentation Controller는 ViewController가 화면에 나타날 때의 Presentation 스타일을 관리합니다.
시스템은 Presentation Controller를 기본으로 제공하고 있고 우리는 커스텀 Presentation Controller를 스스로의 Presentation Style에 적용할 수 있습니다.
우리는 Transitioning Delegate를 사용하기 위해 transitioning Delegate를 만족시키는 Custom Transitioning Delegate 객체를 이동하고자 하는 ViewController에 할당하여 UIKit에게 Custom Transition을 사용하겠다는 것을 알립니다.
이렇게 글로만 보니 대충은 알겠지만 와닿지는 않습니다.
따라서 다음 포스팅에서 직접 구현해보며 개념들을 더 자세히 알아보도록 하겠습니다!
View Controller Programming Guide for iOS: Customizing the Transition Animations
View Controller Programming Guide for iOS
developer.apple.com
https://medium.com/@tungfam/custom-uiviewcontroller-transitions-in-swift-d1677e5aa0bf
'Swift' 카테고리의 다른 글
| 앨범 만들기 5편 - Transitioning Delegate 를 통한 화면전환 애니메이션 구현편 (0) | 2025.11.12 |
|---|---|
| 앨범 만들기 3편 - 무한 스크롤 구현하기 (0) | 2025.11.06 |
| 앨범 만들기 2편 - PHCachImageManager의 requestImage 알아보기 (0) | 2025.11.04 |
| 앨범 만들기 1편 - 앨범에 접근하여 사진 가져오기 (0) | 2025.11.03 |
| Swift - Opaque Type 이란? (1) | 2024.10.17 |
- Total
- Today
- Yesterday
- coredata
- Tuist
- tipview
- Concurrency
- opaquetype
- 알고리즘
- asymptoticnotation
- boxedprotocol
- Xcode
- BoxedType
- private(set)
- kakaomapssdk
- 팁킷
- opaque
- iphone
- Algorithm
- boxedprotocoltype
- 빅세타표기법
- ViewBuilder
- ios
- tipkit
- swift
- reusablelist
- 코어데이터
- 개발자코테
- tuist v4
- 스위프트
- PHCachImageManager
- SwiftUI
- capsulation
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | ||||||
| 2 | 3 | 4 | 5 | 6 | 7 | 8 |
| 9 | 10 | 11 | 12 | 13 | 14 | 15 |
| 16 | 17 | 18 | 19 | 20 | 21 | 22 |
| 23 | 24 | 25 | 26 | 27 | 28 | 29 |
| 30 |
