티스토리 뷰
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 37 | import UIKit class ViewController: UIViewController ,UIPreviewInteractionDelegate{ var preInteraction : UIPreviewInteraction! override func viewDidLoad() { super.viewDidLoad() preInteraction = UIPreviewInteraction(view: view) preInteraction.delegate = self } func previewInteraction(_ previewInteraction: UIPreviewInteraction, didUpdatePreviewTransition transitionProgress: CGFloat, ended: Bool) { print("UpdatePreviewTransition : \(transitionProgress)") view.alpha = 1 - (transitionProgress / 2) if ended { print("Preview Ended") } } func previewInteraction(_ previewInteraction: UIPreviewInteraction, didUpdateCommitTransition transitionProgress: CGFloat, ended: Bool) { print("UpdateCommitTransition : \(transitionProgress)") view.alpha = 0.5 - (transitionProgress / 2) if ended { print("Commit Ended") view.alpha = 1 } } func previewInteractionDidCancel(_ previewInteraction: UIPreviewInteraction) { print("InteractionDidCancel") view.alpha = 1 } } | cs |
'IOS - SWIFT' 카테고리의 다른 글
XCode - 갑자기 file too small for architecture x86_64 에러가 뜬다면. (1) | 2016.12.12 |
---|---|
SWIFT 3 - 커스텀 뷰 만들기 (Custom uiview with xib) (5) | 2016.11.02 |
SWIFT 3 - UILabel 글자 크기 부분 변경(Changing font size inside label) (0) | 2016.10.30 |
SWIFT 3 - URL에서 이미지 가져오기(Download image from URL) (0) | 2016.10.30 |
IOS SWIFT 절댓값 구하기 (abs) (0) | 2016.08.28 |
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday