๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
728x90
๋ฐ˜์‘ํ˜•

๐ŸŽ iOS/iOS49

[iOS] NotificationCenter ๋™์‹œ์— ๋‹ค๋ฅธ ๋ทฐ์ปจํŠธ๋กค๋Ÿฌ ๊ด€๋ฆฌํ•˜๊ธฐ ์ฝ”๋“œ๋ฅผ ์ž‘์„ฑํ•˜๋‹ค ๋ณด๋ฉด ํŠน์ • ๋ทฐ์ปจํŠธ๋กค๋Ÿฌ์—์„œ ์–ด๋–ค ํ–‰๋™์„ ํ–ˆ์„ ์‹œ ๋™์‹œ์— ๋‹ค๋ฅธ ๋ทฐ์ปจํŠธ๋กค๋Ÿฌ๊ฐ€ ๋ณ€ํ™”ํ•˜๊ฒŒ ํ•˜๊ณ ์‹ถ์€ ๊ฒฝ์šฐ๊ฐ€ ๋งŽ์€๋ฐ ์ด ๋•Œ ์œ ์šฉํ•œ๊ฒŒ ๋ฐ”๋กœ NotificationCenter์ด๋‹ค. ๊ฐ’์„ ๋ณด๋‚ด์•ผํ•  ํด๋ž˜์Šค์—์„œ ๋…ธํ‹ฐํ”ผ์ผ€์ด์…˜ ์ด๋ฆ„์„ ์ •ํ•ด์ฃผ๊ณ  NotificationCenter.default.post(name: NSNotification.Name("Notification"), object: nil) ๊ฐ’์„ ๋ฐ›์•„์•ผํ•  ํด๋ž˜์Šค์— ์—๋“œ์˜ต์ €๋ฒ„๋ฅผ ์ ์–ด์ฃผ๊ณ  ์›ํ•˜๋Š” ํ•จ์ˆ˜๋ฅผ ์‹คํ–‰์‹œํ‚ฌ ์…€๋ ‰ํ„ฐ๋ฅผ ์ ์–ด์ค€ ๋‹ค์Œ ๊ฐ’์„ ๋ณด๋ƒˆ๋˜ ๋…ธํ‹ฐํ”ผ์ผ€์ด์…˜ ์ด๋ฆ„์„ ์ ์–ด์ค€๋‹ค, NotificationCenter.default.addObserver(self, selector: #selector(SearchExchangeTag.notifiactionFired(_:)).. 2019. 12. 14.
728x90
๋ฐ˜์‘ํ˜•