iOS14 [iOS] ์คํฌ๋กค ์ ํ์์ ๋ํ๋๊ฒ ํ๊ธฐ CollectionView๊ฐ ์คํฌ๋กค ๋๋์ง ํ์ ํด์ ํน์ ๋ทฐ๋ฅผ ๋์ฐ๊ณ ์ถ์ ๊ฒฝ์ฐ๊ฐ ์์ต๋๋ค! ์ ๊ฐ์ ๊ฒฝ์ฐ์๋ ํ๋จ ์คํฌ๋กค์์ ๊ณ ์ ๋์ด์๋ ์๋จ ๋ก๊ณ ๋ทฐ์ ์คํฌ๋กค ๋๋ ์์ญ ์ฌ์ด์ ํ์์ ์ด ๋ํ๋๋๋ก ํ๋ ํ๋จ๊ณผ ๊ฐ์ ๋ทฐ๋ฅผ ๊ตฌํํ์ด์ผํ๋๋ฐ์! ์ฒ์์ ํฌ์ ์ค์ฒ๋ฅผ ์ด์ฉํ๋ ๊ฒ์ธ๊ฐ ๊ณ ๋ฏผํ์ง๋ง ์ ๋ง ์๊ฐ๋ณด๋ค ์ฌ์ด ์์ ์ด์์ต๋๋ค. 1. CollectionvView๋ฅผ ๊ฐ์ง๊ณ ์๋ ViewController๊ฐ UIScrollViewDelegate๋ฅผ ์ฑํ ํ๋๋ก ํฉ๋๋ค. extension MainViewController: UIScrollViewDelegate{ } 2. scrollViewDidScroll ํจ์๋ฅผ ๊ตฌํํด์ค๋๋ค. ์คํฌ๋กค์์ ๋ด๋ถ์ ์ผ๋ก ํธ์ถ ๋๋ ํจ์์ธ func scrollViewDidScroll(_ scr.. 2023. 2. 2. [iOS] navigationController.present()๋ฅผ ํ๋ฉด ์ด๋ป๊ฒ ๋ ๊น? print(navigationController.viewControllers) // [HomeVC,FriendsListVC] guard let vc = UIStoryboard(name: "FriendsAdd", bundle: nil).instantiateViewController(withIdentifier: FriendsAddVC.identifier) as? FriendsAddVC else { return } vc.modalPresentationStyle = .fullScreen navigationController.present(vc, animated: true) print(navigationController.viewControllers)// [HomeVC,FriendsListVC] navigatio.. 2023. 1. 6. ์ด์ 1 2 3 ๋ค์