Skip to content

Instantly share code, notes, and snippets.

@pulkitsinghal
Created July 18, 2012 13:01
Show Gist options
  • Select an option

  • Save pulkitsinghal/3136074 to your computer and use it in GitHub Desktop.

Select an option

Save pulkitsinghal/3136074 to your computer and use it in GitHub Desktop.
Scan line indicator for ZBar overlays
- (UIView *) loadCameraOverlayView
{
NSString *nibName = @"CameraOverlayView";
NSArray *loadedObjects = [[NSBundle mainBundle] loadNibNamed:nibName owner:nil options:nil];
UIView *overlayView = [loadedObjects lastObject];
overlayView.backgroundColor = [UIColor clearColor];
UIImageView *imageView = (UIImageView*)[overlayView viewWithTag:2];
UIImage *image = [UIImage imageNamed:"red_neon_line_320x10.png"];
imageView.image = image;
[UIView animateWithDuration:1.5
delay:0.0
options:(UIViewAnimationOptionRepeat |
UIViewAnimationOptionAutoreverse |
UIViewAnimationOptionAllowUserInteraction)
animations:^{
imageView.center = CGPointMake(imageView.center.x, imageView.center.y + 280);
}
completion:^(BOOL finished){
}
];
//...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment