【发布时间】:2014-03-05 14:47:29
【问题描述】:
我有一个名为 TargetView 的子类 UIView,其中包含多个 CGPath。当用户单击任何 CGPaths(在 UIView 的 touchesBegan 中)时,我想对父视图控制器进行更改。这是来自 TargetView (UIView) 的代码
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{
CGPoint tap = [[touches anyObject] locationInView:self];
if(CGPathContainsPoint(region, NULL, tap, NO)){
// ...do something to the parent view controller
}
}
我该怎么做?谢谢!
【问题讨论】:
标签: ios iphone uiview uiviewcontroller