-
iOS) collectionview 스크롤링할때 event 케치하기Programing Language/iOS(Swift) 2020. 1. 7. 16:54728x90반응형This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
func scrollViewDidScroll(_ scrollView: UIScrollView) { if scrollView == self.clothes_collectionview { if !self.collection_scroll_flag { UIView.animate(withDuration: 0.5, delay: 0, usingSpringWithDamping: 1, initialSpringVelocity: 1, options: .curveLinear, animations: { self.collection_scroll_flag = true self.control_height_constraint_menu!.constant = self.view.frame.height * 0.2 * -1 self.view.layoutIfNeeded() }, completion: nil) print("변환!") } } } scrollViewDidScroll 은 delagate이기 때문에 viewdidload에서 scoll이 있는 변수에 self를 해준다.
예) clothes_collectionview.delegate = self
728x90반응형'Programing Language > iOS(Swift)' 카테고리의 다른 글
iOS ) url를 이용하여 image 변수안에 url 이미지 넣기 (2) 2020.01.09 iOS ) 소수점 x자리에서 반올림하기 [swift] (0) 2020.01.09 iOS ) UIButton 이미지 안에 마진 주기 (0) 2019.12.26 iOS ) collectionview 수평으로 페이징하기. (0) 2019.12.26 iOS ) collectionview 스크롤 disable (0) 2019.12.26