[iOS] UIResponder
·
iOS
저번 글에 언급해둔바와 같이 이번엔 UIResponder에 대해 알아볼 것이다.공식문서를 한 번 확인해보자 !이벤트 응답 및 처리를 위한 추상 인터페이스라고 한다.이 UIResponder 인스턴스가 바로 저번 글에서 주구장창 나오던 responder 객체이다.이벤트가 발생하면 저번 글에서 봤듯이 UIKit이 지정한(혹은 개발자가 직접 지정한) responder 객체로 이벤트를 보내서 처리하게된다.이 responder 객체가 이벤트를 처리하기위해서는 적절한 메소드들을 오버라이딩하여 처리해줘야한다. 예를 들어 Touch 이벤트가 일어나면 touchesBegan(_:with:), touchesMoved(_:with:), touchesEnded(_:with:), touchesCancelled(_:with:) ..
[iOS] 이벤트 처리
·
iOS
원래는 UIResponder에 대해 알아보려했는데, UIResponder를 알아보기 전 아이폰에 이벤트가 발생하면 어떤 식으로 처리되는지를 먼저 알아보면 좋을 것 같아 Using responders and the responder chain to handle events라는 아티클을 읽고 이해해보는 시간을 선행해서 가져보려고 한다.Handle events앱은 responder 객체를 사용해서 앱에서 이벤트를 받거나 처리한다.이 responder 객체란 UIResponder 클래스 인스턴스 혹은 UIView, UIViewController, UIApplication을 포함한 여러 UIResponder의 서브클래스들을 말한다.이 responder들은 이벤트를 받으면 그걸 그 자리에서 처리하거나 다른 resp..
[iOS] Container view controller
·
iOS
오늘은 Container view controller에 대해 알아볼 예정이다. 주인장은 이 글에 대해 정리하기 전까진 Container view controller가 UIViewController마냥 따로 만들어져있는 클래스 그런건 줄 알았다..ㅎ (나같은 사람 분명 있을거야 ^_^)시작해보자 ~Container view controller 란?Container view controller는 다른 view controller들을 관리하는 view controller의 종류 중 하나이다.자기 자신의 view를 가지고있는 content view controller와는 다르게 container view controller는 보통 자신의 뷰를 가지고 있지않다. 그럼 container view controller..