728x90
반응형
//
// ViewController.swift
// PinGuesture-02
//
// Created by Leo_Jang on 27/08/2020.
// Copyright © 2020 Leo_Jang. All rights reserved.
//
import UIKit
class ViewController: UIViewController {
@IBOutlet weak var imgPinch: UIImageView!
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
let pinch = UIPinchGestureRecognizer(target: self, action: #selector(ViewController.doPinch(_ :)))
self.view.addGestureRecognizer(pinch)
}
@objc func doPinch(_ pinch: UIPinchGestureRecognizer){
imgPinch.transform = imgPinch.transform.scaledBy(x: pinch.scale, y: pinch.scale)
pinch.scale = 1 // 다음 변환을 위한 scale의 속성을 1로 설정
}
}
반응형
'개발자 코드(Code) > Swfit' 카테고리의 다른 글
IOS) PageControl + Map (PageControl + ImageView + Label) (0) | 2020.08.30 |
---|---|
IOS) Swipe Guesture + PageControl (한 손가락 넘기기 + 두 손가락 넘기기 + PageControl 사용) (0) | 2020.08.27 |
IOS) PinGuesture (글자 확대) (0) | 2020.08.27 |
IOS ) SwipeGuesture(스와이프 제스쳐) (0) | 2020.08.27 |
IOS) GPS 위치 (사진필요) (0) | 2020.08.27 |