N.nnd N.nnd - 1 year ago 69
iOS Question

Why my view can not recognize the UIPanGestureRecognizer?

When I tag the image, there is no things to show? Why?

enter image description here

enter image description here

Answer Source
- (void)viewDidLoad {
    [super viewDidLoad];

    _view2 = [[V0 alloc ]initWithFrame:self.view.bounds];
    CGRect a = self.view2.frame;
    a.origin.x = 100;
    a.origin.y = 150;
    _view2.frame = a;
    _view2.userInteractionEnabled = YES;

    [self.view2 addGestureRecognizer:[[UIPanGestureRecognizer alloc]initWithTarget:self.view2 action:@selector(Up:)]];

i add the initWithFrame ,then my view can recognize my gesture

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download