Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

dantastic

macrumors 6502a
Original poster
Jan 21, 2011
572
678
So I've these nifty block based animations going at the moment. UIView animateWithDuration..

This locks the screen completely so I want to set the propertly userInteractionEnabled as it will allow me to accept touches while the animation is ongoing etc.

Where & how do I set this property??? I've set the userInteractionEnabled = YES to every single view I create but I still can't do anything until the animation has finished...

Code:
- (void) slideLayerDown {
    self.view.userInteractionEnabled = YES;
    
    UIImage *image = [UIImage imageNamed:@"tst.jpg"];
    baseImageView.image = image;
    baseImageView.userInteractionEnabled = YES;
    
    slideLayer = [[UIView alloc] initWithFrame:CGRectMake(0, -50, 320, 516)];
    slideLayer.backgroundColor = [UIColor clearColor];
    slideLayer.userInteractionEnabled = YES;
    
    GradientView *gradientView = [[GradientView alloc] initWithFrame:CGRectMake(0, 0, 320, 50)];
    gradientView.userInteractionEnabled = YES;
    [slideLayer addSubview:gradientView];
    
    UIView *bottomView = [[UIView alloc] initWithFrame:CGRectMake(0, 50, 320, 466)];
    bottomView.backgroundColor = [UIColor whiteColor];
    bottomView.userInteractionEnabled = YES;
    [slideLayer addSubview:bottomView];
    
    [baseImageView addSubview:slideLayer];
    
    CGRect frame = slideLayer.frame;
    frame.origin.y = 420;
    
    [UIView animateWithDuration:60 animations:^(void) {
        slideLayer.frame = frame;
    }];
}
In the above we have baseImageView sitting directly on top of self.view set up in IB.

thanks!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.