Code Monkey home page Code Monkey logo

uigesturerecognize-study's Introduction

UIGestureRecognize-study


UIGestureRecognizer

GestureRecognizer는 일련의 터치(또는 기타 입력)을 인식하고 해당 인식에 따라 작동하는 로직을 분리한다. UIGestureRecognizer가 제스처의 변경을 인식하면 지정된 각 대상 객체에 작업 메세지를 보낸다.
각 대상 개체는 다음과 같다.

  • UITapGestureRecognizer
  • UIPinchGestureRecognizer
  • UIRotationGestureRecognizer
  • UISwipeGestureRecognizer
  • UIPanGestureRecognizer
  • UIScreenEdgePanGestureRecognizer
  • UILongPressGestureRecognizer
  • UIHoverGestureRecognizer

위의 클래스들은 delegate 패턴을 지원하고 특정행동에 대한 커스텀도 지원한다. 특정 뷰에 대한 터치를 인식하고 그뷰의 서브뷰에 대한 터치도 같이 인식한다. 그리고 이렇게 뷰에 대한 터치를 인식하려면 addGestureRecognizer()를 호출해주어야 한다. gesture recognize는 뷰의 'responder chain' 에 들어가지 않는다.

responder chain이란 해당 뷰에서 이벤트가 일어났지만 그 이벤트를 핸들링하지 않을 경우 
점점 상위계층으로 올라가서 이벤트 핸들링을 물어보는것. 끝까지 없으면 아무일도 일어나지 않는다. 
ex : UILabel -> UIView -> UIViewController -> UIWindow 
-> UIApplication -> UIApplicationDelegate
참고 : https://seizze.github.io/2019/11/26/iOS%EC%9D%98-Responder%EC%99%80-Responder-Chain-%EC%9D%B4%ED%95%B4%ED%95%98%EA%B8%B0.html

매크로 Thinking

UIPanGesture을 이용한 지속적인 좌푯값 없데이트를 통해 손과 발의 위치를 지속적으로 변경한다.

uigesturerecognize-study's People

Contributors

commitcomplete avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.