본문 바로가기
[iOS Study] 델리게이션과 텍스트 입력 [iOS Study] 델리게이션과 텍스트 입력 출처 : 아론 힐리가스의 iOS 프로그래밍 -UITextField 인스턴스는 사용자가 텍스트를 수정할 수 있게 해준다. -UIResponder 는 UIKit 프레임워크에 존재하는 추상 클래스이다.다음 세 클래스는 UIResponder 의 하위 클래스이다. UIView, UIViewController, UIApplication UIResponse 는 이벤트를 제어하는 메소드들을 정의한다.이벤트에는 터치 이벤트, 흔들기와 같은 모션 이벤트, 재생/정지와 같은 원격 제어 이벤트 등이 있다.하위 클래스들은 이런 이벤트에 응답하기 위해 각각에 따라 이들 메소드를 재정의한다. -UIWindow 는 다른 이벤트들에 응답할 객체를 가리키는 퍼스트 리스폰더 (first re.. 2016. 2. 19.
@NotNull annotation 의 장점 @NotNull annotation 의 장점 http://robaustin.wikidot.com/annotations-and-notnullhttps://www.jetbrains.com/idea/documentation/howto.html - Find Bugs 와 IntelliJ 는 null check annotation 을 지원한다. 코드 가독성 측면에서 좋지 않다는 이야기도 있지만, 그건 케바케. - function 의 param 에 null 이 들어오면 RuntimeException 을 던지도록 처리하는 것이 좋다.public void testMethodNotNull( @NotNull String param ){ // do sth.}만약 method 선언부에 @NotNull 을 선언하면, valida.. 2015. 6. 23.
[Java] How to implements Iterator. Java, How to implements Iterator. Aggregate 인터페이스 public interface Aggregate{public abstract Iterator iterator();} Iterator 를 제공하려는 container class 는 Aggregate 를 implements 해야 함.Aggregate Interface 를 implement 한 class 를 ConcreteAggregate class 라 부른다. Iterator 인터페이스 public interface Iterator{public abstract boolean hasNext();public abstract Object enxt();} Iterator 를 구현한 class 를 ConcreteIterator .. 2014. 1. 10.
[android] Long Press ( Long Click ) 직접 구현하기 안드로이드 Long Press (Long Click) 직접구현하기 안드로이드를 사용하다 보면 가끔 view 끼리의 focus 나 touch event 문제 등에 봉착하여Long Press ( Long Click ) 을 직접 구현해야 할 때가 있다.그래서 한번 구현해보았다. public class LongPressChecker {public interface OnLongPressListener{public void onLongPressed();} private Handler mHandler = new Handler();private LongPressCheckRunnable mLongPressCheckRunnable = new LongPressCheckRunnable();private int mLongPre.. 2013. 7. 7.
반응형