standwally

Motion event 본문

프로그래밍/iOS

Motion event

standwally 2013. 3. 4. 16:31

- (void)motionBegan:(UIEventSubtype)motion withEvent:(UIEvent *)event NS_AVAILABLE_IOS(3_0);

- (void)motionEnded:(UIEventSubtype)motion withEvent:(UIEvent *)event NS_AVAILABLE_IOS(3_0);

iOS에서 위와 같은 Motion events를 사용하기 위해서는 아래 메서드들을 오버라이딩해야한다.

- (BOOL)canBecomeFirstResponder
{
    return YES;
}

- (void)viewDidAppear:(BOOL)animated
{
    [self becomeFirstResponder];
}