๋ฐ์ํ
- custom view controller transition ์ ์ํ ํ๋กํ ์ฝ
- ๋ทฐ ์ปจํธ๋กค๋ฌ์ ํ๋ฉด ์ ํ์ ์ํ ์ ๋๋ฉ์ด์ ์ ๋ง๋๋ animator ๊ฐ์ฒด๋ฅผ ์ ์ํ ์ ์์
- ์ธํฐ๋ ํฐ๋ธ ํธ๋์ง์ ์ ์ฌ์ฉํ๊ธฐ ์ํด์๋ animator ๊ฐ์ฒด๋ฅผ ํ์ด๋ฐ์ ์ ์ดํ ์ ์๋ ๋ค๋ฅธ ๊ฐ์ฒด์ ๊ฒฐํฉํด์ผ ํจ
- ์ด ํ๋กํ ์ฝ์ ์ฌ์ฉํ๊ธฐ ์ํด์ transitionDuration(using:), animateTransition(using:) ์ ๊ตฌํํด์ผ ํจ
- UIViewControllerTransitioningDelegate ํ๋กํ ์ฝ์ ๋ฐ๋ฅด๋ ๊ฐ์ฒด์์ animator ๊ฐ์ฒด๋ฅผ ์์ฑํจ
- ๋ทฐ ์ปจํ๋กค๋ฌ ํ๋ฉด ์ ํ ์ presnet ํ ๊ฒฝ์ฐ UIModalPresentationStyle.custom์ผ๋ก ์ง์ ํด ์ค
- animator๊ฐ์ฒด๋ UIViewControllerTransitioningDelegate์ transitioningDelegate๋ฅผ ์ง์ ํด ์ค. transitionigDelegate๋ก ๋ถํฐ animator๊ฐ์ฒด๋ฅผ ๋ฐํ ๋ฐ๊ณ ์ ๋๋ฉ์ด์ ์ ์ํํจ
- presenting, dismissing ๊ฐ๊ฐ ์ ๋๋ฉ์ด์ ์ ์ง์ ํ ์ ์์(poping, pushing ๋ง์ฐฌ๊ฐ์ง)
transitionDuration(using:)
- ํ๋ฉด ์ ํ ์๊ฐ์ ์ ์ํ๋ค
animateTransition(using:)
- ์ ๋๋ฉ์ด์ ์ ์ ์ํจ
- ํ๋ฉด ์ ํ์ ๊ด๋ จ๋ ์ ๋ณด๋ ์ปจํ
์คํธ ํํ์ ๊ฐ์ฒด๋ก ํด๋น ๋ฉ์๋์ ์ ๋ฌ ๋จ
- ์ด ์ ๋ณด๋ฅผ ์ฌ์ฉํด์ ๋ทฐ ์ปจํ๋กค๋ฌ์ ๋ทฐ๋ฅผ ์ ์ดํ๊ฒ ๋จ
- ํ๋ฉด ์ ํ์ ์ ๋๋ฉ์ด์
๋ฟ๋ง ์๋๋ผ ์ฌ์ฉ์์์ interaction์ด ๋ค์ด๊ฐ์ผ ํ๋ฉด ์๋ ํ๋กํ ์ฝ์ ๊ตฌํํด์ผ ํจ
- UIViewControllerInteractiveTransitioning https://developer.apple.com/documentation/uikit/uiviewcontrollerinteractivetransitioning
728x90
๋ฐ์ํ
'๐ iOS' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[iOS/Swift] UIPresentationController (0) | 2023.01.29 |
---|---|
[iOS/Swift] UIViewControllerTransitioningDelegate (0) | 2023.01.29 |
[Pod/iOS] Pod ๋ผ์ด๋ธ๋ฌ๋ฆฌ ์์ฑํ๊ณ ๊ด๋ฆฌํ๊ธฐ (0) | 2023.01.29 |
[iOS Swift] Deeplink ์ฌ์ฉํ๊ธฐ (0) | 2022.12.29 |
[SwiftUI] Sticky Header ์คํฌ๋กค์ ๊ณ ์ ์ํค๊ธฐ (0) | 2022.12.17 |
๋๊ธ