搜尋此網誌

顯示具有 click view 標籤的文章。 顯示所有文章
顯示具有 click view 標籤的文章。 顯示所有文章

2012年9月23日 星期日

evnet click view 點擊畫面的事件觸發


- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
    [self performSegueWithIdentifier:@"LoginSegue" sender:nil];
}


You can use UIView subclass and handle touch event there. Methods to look at (defined inUIResponder):
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event- (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event
If you want to use "invisible" UIButton you should set its type to UIButtonTypeCustom - by default it will appear with no image and title and with transparent background. So technically it will be invisible to user but still be able to respond to all events.