티스토리 뷰
iOS(swift)
[Swift 4] Fakebook 만들기 - 6. Add TapGesture, UIView Animation, ZoomOut, Cell Animation
광그로 2017. 11. 25. 23:24#Add TapGesture #UIView Animation #ZoomOut #Cell Animation
프로젝트 코드 : https://github.com/LeeGwangYong/iOS_swift/tree/master/FaceBook
참고 사이트 : https://www.youtube.com/watch?v=NJxb7EKXF3U&list=PL0dzCUj1L5JHDWIO3x4wePhD8G4d1Fa6N
1. ViewController.swift 추가
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | @objc func animateToCenter(feedImageView: UIImageView) { self.feedImageView = feedImageView if let startingFrame = feedImageView.superview?.convert(feedImageView.frame, to: nil) { ... subView.image = feedImageView.image subView.contentMode = feedImageView.contentMode subView.clipsToBounds = true subView.frame = startingFrame subView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(FeedController.zoomOut))) subView.isUserInteractionEnabled = true view.addSubview(subView) ... } } @objc func zoomOut() { if let startingFrame = feedImageView!.superview?.convert(feedImageView!.frame, to: nil) { UIView.animate(withDuration: 0.75, animations:{()->Void in self.subView.frame = startingFrame self.blackView.alpha = 0 self.navigationController?.navigationBar.alpha = 1 }, completion: { (didComplete) in self.subView.removeFromSuperview() self.blackView.removeFromSuperview() self.feedImageView?.alpha = 1 }) } } | cs |
'iOS(swift)' 카테고리의 다른 글
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- 객체
- MVVM
- C++
- CustomCollectionViewCell
- 문자열
- BOJ
- Fakebook
- XAML
- Custom Cell
- 백준
- FEED
- 스택
- dfs
- BFS
- 그래프
- UIView Animation
- Cell Animation
- Grid
- Add TapGesture
- 생활코딩
- CollectionView
- 백준온라인
- WPF
- 데이터 바인딩
- 타일링
- DP
- command
- 코딩야학
- listview
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
글 보관함