2017-04-10 4 views
1

こんにちは友人は、私はUIWindowにUITapGestureを追加したが、私はできません 、私を助けてくださいことができ、アクセス親コントロールobjective-cのUITapGestureのサブビューコントロールにアクセスする方法は?画面内

UIRotationGestureRecognizer *rot =[[UIRotationGestureRecognizer alloc] initWithTarget:self action:@selector(handleRotation:)]; 

rot.cancelsTouchesInView = NO; 
rot.delegate = self; 
UIPinchGestureRecognizer *pinch =[[UIPinchGestureRecognizer alloc] initWithTarget:self 
action:@selector(handlePinch:)]; 
pinch.cancelsTouchesInView = NO; 
pinch.delegate = self; 
/* UIPanGestureRecognizer *pan = [[UIPanGestureRecognizer alloc] initWithTarget:self 
action:@selector(handlePan:)]; 
pan.cancelsTouchesInView = NO; 
pan.delegate = self;*/ 


//circle gesture 
gr = [[MDCircleGestureRecognizer alloc] init]; 
[gr addTarget:self action:@selector(handleGesture:)]; 
//[self.view addGestureRecognizer:gr]; 
//gr.delegate = (id<MDCircleGestureFailureDelegate>)self.view; 
gr.delegate = self; 
gr.cancelsTouchesInView = NO; 

////Z gesture 
cg = [[CharGesture alloc] initWithTarget:self action:@selector(zLetterMade:)]; 
cg.delegate=self; 
cg.cancelsTouchesInView = NO; 
//Add on window - RR 
[[[UIApplication sharedApplication]delegate]window].gestureRecognizers = @[gr,cg,pinch,rot]; 

答えて

0

あなたがUIGestureRecognizerDelegateを与えていることを確認し、相互作用を受け入れるための[[[UIApplication sharedApplication]delegate]window].userInteractionEnabled=YES;

+0

感謝を有効にしてください回答 –

関連する問題