Notification2 [iOS] ํธ์์๋ฆผ ๋ฐ์์ ์ฒ๋ฆฌํ๊ธฐ ํธ์์๋ฆผ์ ํตํด ์ฑ์ ๋ค์ด์ค๋ ๊ฒฝ์ฐ๋ ํฌ๊ฒ ๋๊ฐ์ง๋ก ๋๋ ์ ์์ด๋๋ค ์ฑ์ด ์์ ํ ์ข ๋ฃ๋ ์ํ inactive/active/background ์ํ 1๏ธโฃ ์ฑ์ด ์์ ํ ์ข ๋ฃ๋ ์ํ์์ ํธ์์๋ฆผ์ ํตํด ์ฑ์ ๋ค์ด์ค๋ ๊ฒฝ์ฐ SceneDelegate์ willConnectTo์์ ์ฒ๋ฆฌ class SceneDelegate: UIResponder, UIWindowSceneDelegate { ... func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { ... // ์ฑ ์ข ๋ฃ ์ํ์์ ํธ์์๋ฆผ์ ํตํด ์ฑ์ ์ ์ํ๋ ๊ฒฝ์ฐ if let notificatio.. 2022. 10. 12. [iOS] Notification Center ๐ก Notification Center์ด๋? ํน์ ์ด๋ฒคํธ ๋ฐ์์, ํด๋น ์ด๋ฒคํธ์ ๋ฐ์ ์ฌ๋ถ๋ฅผ observe ํ๊ฒ ๋ค๊ณ ๋ฑ๋กํ ๋ชจ๋ observer์๊ฒ ์ ๋ฌํด์ฃผ๋ ๊ฐ์ฒด ์ธ์ ์ฌ์ฉํ๋ฉด ์ข์๊นโ ์ผ๋๋ค ๋๋ ๋ค๋๋ค ํต์ ์ด ํ์ํ ๊ฒฝ์ฐ ์ฑ ๋ด์์ ๋ช ์์ ์ผ๋ก ์ฐ๊ฒฐ๋์ง ์์ ์ปดํฌ๋ํธ ๊ฐ์ ์ํธ์์ฉ์ด ํ์ํ ๊ฒฝ์ฐ ํผ์ด๋ผ๋ ์ด๋ฆ์ notification์ ๊ด์ฐฐํ๊ณ ์๋ FirstVC์๊ฒ ํด๋น noti๊ฐ ์ ๋ฌ๋ฉ๋๋ค! SecondVC์์ dismiss completion์ ํด๋น ํผ์ด๋ผ๋ ์ด๋ฆ์ notification ์ post ํด์ฃผ๋ฉด FirstVC์์ ํผ์ด๋ผ๋ ์ด๋ฆ์ notification ์ ๊ด์ฐฐํ๊ฒ ๋ค๊ณ addObserve ํ๊ณ ex) ํ๋ฉด ์ ํ ํ pop ๋๋ dismissํ ๋ ๋์์จ VC์ ์ํ ๋ฌด์ธ๊ฐ๋ฅผ ์คํํด์ผ ํ๋.. 2022. 3. 14. ์ด์ 1 ๋ค์