Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: b5357fa4ee
Fetching contributors…

Cannot retrieve contributors at this time

79 lines (57 sloc) 1.746 kb
//
// Asset.m
//
// Created by Matt Tuzzolo on 2/15/11.
// Copyright 2011 ELC Technologies. All rights reserved.
//
#import "ELCAsset.h"
#import "ELCAssetTablePicker.h"
@implementation ELCAsset
@synthesize asset;
@synthesize parent;
- (id)initWithFrame:(CGRect)frame {
if ((self = [super initWithFrame:frame])) {
// Initialization code
}
return self;
}
-(id)initWithAsset:(ALAsset*)_asset {
if (self = [super initWithFrame:CGRectMake(0, 0, 0, 0)]) {
self.asset = _asset;
CGRect viewFrames = CGRectMake(0, 0, 75, 75);
UIImageView *assetImageView = [[UIImageView alloc] initWithFrame:viewFrames];
[assetImageView setContentMode:UIViewContentModeScaleToFill];
[assetImageView setImage:[UIImage imageWithCGImage:[self.asset thumbnail]]];
[self addSubview:assetImageView];
[assetImageView release];
overlayView = [[UIImageView alloc] initWithFrame:viewFrames];
[overlayView setImage:[UIImage imageNamed:@"Overlay.png"]];
[overlayView setHidden:YES];
[self addSubview:overlayView];
}
return self;
}
-(void)toggleSelection {
overlayView.hidden = !overlayView.hidden;
// if([(ELCAssetTablePicker*)self.parent totalSelectedAssets] >= 10) {
//
// UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Maximum Reached" message:@"" delegate:self cancelButtonTitle:nil otherButtonTitles:@"Ok", nil];
// [alert show];
// [alert release];
//
// [(ELCAssetTablePicker*)self.parent doneAction:nil];
// }
}
-(BOOL)selected {
return !overlayView.hidden;
}
-(void)setSelected:(BOOL)_selected {
[overlayView setHidden:!_selected];
}
- (void)dealloc
{
self.asset = nil;
[overlayView release];
[super dealloc];
}
@end
Jump to Line
Something went wrong with that request. Please try again.