Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Memory fixes. Reorg of code. Performance enhancements.

  • Loading branch information...
commit 6d5978b29d8330618574b6509e8dddb2c347130a 1 parent b5c54b4
Matt Tuzzolo authored
View
24 Classes/ELCAlbumPickerController.h
@@ -0,0 +1,24 @@
+//
+// AlbumPickerController.h
+//
+// Created by Matt Tuzzolo on 2/15/11.
+// Copyright 2011 ELC Technologies. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+
+@interface ELCAlbumPickerController : UITableViewController {
+
+ NSMutableArray *assetGroups;
+ NSOperationQueue *queue;
+ id parent;
+}
+
+@property (nonatomic, assign) id parent;
+@property (nonatomic, retain) NSMutableArray *assetGroups;
+
+-(void)selectedAssets:(NSArray*)_assets;
+
+@end
+
View
169 Classes/ELCAlbumPickerController.m
@@ -0,0 +1,169 @@
+//
+// AlbumPickerController.m
+//
+// Created by Matt Tuzzolo on 2/15/11.
+// Copyright 2011 ELC Technologies. All rights reserved.
+//
+
+#import <AssetsLibrary/AssetsLibrary.h>
+#import "ELCAlbumPickerController.h"
+#import "ELCImagePickerController.h"
+#import "ELCAssetTablePicker.h"
+
+@implementation ELCAlbumPickerController
+
+@synthesize parent, assetGroups;
+
+#pragma mark -
+#pragma mark View lifecycle
+
+- (void)viewDidLoad {
+ [super viewDidLoad];
+
+ [self.navigationItem setTitle:@"Loading..."];
+
+ UIBarButtonItem *cancelButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self.parent action:@selector(cancelImagePicker)];
+ [self.navigationItem setRightBarButtonItem:cancelButton];
+ [cancelButton release];
+
+ NSMutableArray *tempArray = [[NSMutableArray alloc] init];
+ self.assetGroups = tempArray;
+ [tempArray release];
+
+ // Load Albums into assetGroups
+ dispatch_async(dispatch_get_main_queue(), ^
+ {
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+
+ // Group enumerator Block
+ void (^assetGroupEnumerator)(struct ALAssetsGroup *, BOOL *) = ^(ALAssetsGroup *group, BOOL *stop)
+ {
+ if (group == nil)
+ {
+ return;
+ }
+
+ [self.assetGroups addObject:group];
+
+ // Keep this line! w/o it the asset count is broken for some reason. Makes no sense
+ NSLog(@"count: %d", [group numberOfAssets]);
+
+ // Reload albums
+ [self performSelectorOnMainThread:@selector(reloadTableView) withObject:nil waitUntilDone:YES];
+ };
+
+ // Group Enumerator Failure Block
+ void (^assetGroupEnumberatorFailure)(NSError *) = ^(NSError *error) {
+
+ UIAlertView * alert = [[UIAlertView alloc] initWithTitle:@"Error" message:[NSString stringWithFormat:@"Album Error: %@", [error description]] delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil];
+ [alert show];
+ [alert release];
+
+ NSLog(@"A problem occured %@", [error description]);
+ };
+
+ // Enumerate Albums
+ ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init];
+ [library enumerateGroupsWithTypes:ALAssetsGroupAll
+ usingBlock:assetGroupEnumerator
+ failureBlock:assetGroupEnumberatorFailure];
+
+
+ [library release];
+ [pool release];
+ });
+}
+
+-(void)reloadTableView {
+
+ [self.tableView reloadData];
+ [self.navigationItem setTitle:@"Select an Album"];
+}
+
+-(void)selectedAssets:(NSArray*)_assets {
+
+ [(ELCImagePickerController*)parent selectedAssets:_assets];
+}
+
+#pragma mark -
+#pragma mark Table view data source
+
+- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
+ // Return the number of sections.
+ return 1;
+}
+
+
+- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
+ // Return the number of rows in the section.
+ return [assetGroups count];
+}
+
+
+// Customize the appearance of table view cells.
+- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
+
+ static NSString *CellIdentifier = @"Cell";
+
+ UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
+ if (cell == nil) {
+ cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
+ }
+
+ // Get count
+ ALAssetsGroup *g = (ALAssetsGroup*)[assetGroups objectAtIndex:indexPath.row];
+ [g setAssetsFilter:[ALAssetsFilter allPhotos]];
+ NSInteger gCount = [g numberOfAssets];
+
+ cell.textLabel.text = [NSString stringWithFormat:@"%@ (%d)",[g valueForProperty:ALAssetsGroupPropertyName], gCount];
+ [cell.imageView setImage:[UIImage imageWithCGImage:[(ALAssetsGroup*)[assetGroups objectAtIndex:indexPath.row] posterImage]]];
+ [cell setAccessoryType:UITableViewCellAccessoryDisclosureIndicator];
+
+ return cell;
+}
+
+#pragma mark -
+#pragma mark Table view delegate
+
+- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
+
+ ELCAssetTablePicker *picker = [[ELCAssetTablePicker alloc] initWithNibName:@"AssetTablePicker" bundle:[NSBundle mainBundle]];
+ picker.parent = self;
+
+ // Move me
+ picker.assetGroup = [assetGroups objectAtIndex:indexPath.row];
+ [picker.assetGroup setAssetsFilter:[ALAssetsFilter allPhotos]];
+
+ [self.navigationController pushViewController:picker animated:YES];
+ [picker release];
+}
+
+- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
+
+ return 57;
+}
+
+#pragma mark -
+#pragma mark Memory management
+
+- (void)didReceiveMemoryWarning {
+ // Releases the view if it doesn't have a superview.
+ [super didReceiveMemoryWarning];
+
+ // Relinquish ownership any cached data, images, etc that aren't in use.
+}
+
+- (void)viewDidUnload {
+ // Relinquish ownership of anything that can be recreated in viewDidLoad or on demand.
+ // For example: self.myOutlet = nil;
+}
+
+
+- (void)dealloc
+{
+ [assetGroups release];
+ [super dealloc];
+}
+
+@end
+
View
0  Classes/AlbumPickerController.xib → Classes/ELCAlbumPickerController.xib
File renamed without changes
View
25 Classes/ELCAsset.h
@@ -0,0 +1,25 @@
+//
+// Asset.h
+//
+// Created by Matt Tuzzolo on 2/15/11.
+// Copyright 2011 ELC Technologies. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+#import <AssetsLibrary/AssetsLibrary.h>
+
+
+@interface ELCAsset : UIView {
+ ALAsset *asset;
+ UIImageView *overlayView;
+ BOOL selected;
+ id parent;
+}
+
+@property (nonatomic, retain) ALAsset *asset;
+@property (nonatomic, assign) id parent;
+
+-(id)initWithAsset:(ALAsset*)_asset;
+-(BOOL)selected;
+
+@end
View
78 Classes/ELCAsset.m
@@ -0,0 +1,78 @@
+//
+// 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:@"You've reached the max number of photos for your video." 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
+
View
21 Classes/ELCAssetCell.h
@@ -0,0 +1,21 @@
+//
+// AssetCell.h
+//
+// Created by Matt Tuzzolo on 2/15/11.
+// Copyright 2011 ELC Technologies. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+
+@interface ELCAssetCell : UITableViewCell
+{
+ NSArray *rowAssets;
+}
+
+-(id)initWithAssets:(NSArray*)_assets reuseIdentifier:(NSString*)_identifier;
+-(void)setAssets:(NSArray*)_assets;
+
+@property (nonatomic,retain) NSArray *rowAssets;
+
+@end
View
56 Classes/ELCAssetCell.m
@@ -0,0 +1,56 @@
+//
+// AssetCell.m
+//
+// Created by Matt Tuzzolo on 2/15/11.
+// Copyright 2011 ELC Technologies. All rights reserved.
+//
+
+#import "ELCAssetCell.h"
+#import "ELCAsset.h"
+
+@implementation ELCAssetCell
+
+@synthesize rowAssets;
+
+-(id)initWithAssets:(NSArray*)_assets reuseIdentifier:(NSString*)_identifier {
+
+ if(self = [super initWithStyle:UITableViewStylePlain reuseIdentifier:_identifier]) {
+
+ self.rowAssets = _assets;
+ }
+
+ return self;
+}
+
+-(void)setAssets:(NSArray*)_assets {
+
+ for(UIView *view in [self subviews])
+ {
+ [view removeFromSuperview];
+ }
+
+ self.rowAssets = _assets;
+}
+
+-(void)layoutSubviews {
+
+ CGRect frame = CGRectMake(4, 2, 75, 75);
+
+ for(ELCAsset *elcAsset in self.rowAssets) {
+
+ [elcAsset setFrame:frame];
+ [elcAsset addGestureRecognizer:[[[UITapGestureRecognizer alloc] initWithTarget:elcAsset action:@selector(toggleSelection)] autorelease]];
+ [self addSubview:elcAsset];
+
+ frame.origin.x = frame.origin.x + frame.size.width + 4;
+ }
+}
+
+-(void)dealloc
+{
+ [rowAssets release];
+
+ [super dealloc];
+}
+
+@end
View
435 Classes/ELCAssetPicker.xib
@@ -0,0 +1,435 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="7.10">
+ <data>
+ <int key="IBDocument.SystemTarget">1024</int>
+ <string key="IBDocument.SystemVersion">10F569</string>
+ <string key="IBDocument.InterfaceBuilderVersion">804</string>
+ <string key="IBDocument.AppKitVersion">1038.29</string>
+ <string key="IBDocument.HIToolboxVersion">461.00</string>
+ <object class="NSMutableDictionary" key="IBDocument.PluginVersions">
+ <string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string key="NS.object.0">123</string>
+ </object>
+ <object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <integer value="6"/>
+ </object>
+ <object class="NSArray" key="IBDocument.PluginDependencies">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ </object>
+ <object class="NSMutableDictionary" key="IBDocument.Metadata">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys" id="0">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ </object>
+ <object class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBProxyObject" id="372490531">
+ <string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ </object>
+ <object class="IBProxyObject" id="975951072">
+ <string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ </object>
+ <object class="IBUIView" id="191373211">
+ <reference key="NSNextResponder"/>
+ <int key="NSvFlags">274</int>
+ <object class="NSMutableArray" key="NSSubviews">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBUIScrollView" id="278847582">
+ <reference key="NSNextResponder" ref="191373211"/>
+ <int key="NSvFlags">268</int>
+ <string key="NSFrameSize">{320, 416}</string>
+ <reference key="NSSuperview" ref="191373211"/>
+ <object class="NSColor" key="IBUIBackgroundColor">
+ <int key="NSColorSpace">1</int>
+ <bytes key="NSRGB">MSAxIDEAA</bytes>
+ </object>
+ <bool key="IBUIClipsSubviews">YES</bool>
+ <bool key="IBUIMultipleTouchEnabled">YES</bool>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ </object>
+ </object>
+ <string key="NSFrameSize">{320, 416}</string>
+ <reference key="NSSuperview"/>
+ <object class="NSColor" key="IBUIBackgroundColor">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MQA</bytes>
+ <object class="NSColorSpace" key="NSCustomColorSpace">
+ <int key="NSID">2</int>
+ </object>
+ </object>
+ <object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
+ <object class="IBUISimulatedNavigationBarMetrics" key="IBUISimulatedTopBarMetrics">
+ <bool key="IBUIPrompted">NO</bool>
+ </object>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ </object>
+ </object>
+ <object class="IBObjectContainer" key="IBDocument.Objects">
+ <object class="NSMutableArray" key="connectionRecords">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">view</string>
+ <reference key="source" ref="372490531"/>
+ <reference key="destination" ref="191373211"/>
+ </object>
+ <int key="connectionID">3</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">scrollview</string>
+ <reference key="source" ref="372490531"/>
+ <reference key="destination" ref="278847582"/>
+ </object>
+ <int key="connectionID">7</int>
+ </object>
+ </object>
+ <object class="IBMutableOrderedSet" key="objectRecords">
+ <object class="NSArray" key="orderedObjects">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBObjectRecord">
+ <int key="objectID">0</int>
+ <reference key="object" ref="0"/>
+ <reference key="children" ref="1000"/>
+ <nil key="parent"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">1</int>
+ <reference key="object" ref="191373211"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="278847582"/>
+ </object>
+ <reference key="parent" ref="0"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-1</int>
+ <reference key="object" ref="372490531"/>
+ <reference key="parent" ref="0"/>
+ <string key="objectName">File's Owner</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-2</int>
+ <reference key="object" ref="975951072"/>
+ <reference key="parent" ref="0"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">6</int>
+ <reference key="object" ref="278847582"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ <reference key="parent" ref="191373211"/>
+ </object>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="flattenedProperties">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>-1.CustomClassName</string>
+ <string>-2.CustomClassName</string>
+ <string>1.IBEditorWindowLastContentRect</string>
+ <string>1.IBPluginDependency</string>
+ <string>6.IBPluginDependency</string>
+ <string>6.IBViewBoundsToFrameTransform</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>AssetPicker</string>
+ <string>UIResponder</string>
+ <string>{{575, 376}, {320, 480}}</string>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <object class="NSAffineTransform">
+ <bytes key="NSTransformStruct">P4AAAL+AAAAAAAAAw88AAA</bytes>
+ </object>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="unlocalizedProperties">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference key="dict.sortedKeys" ref="0"/>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ </object>
+ <nil key="activeLocalization"/>
+ <object class="NSMutableDictionary" key="localizations">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference key="dict.sortedKeys" ref="0"/>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ </object>
+ <nil key="sourceID"/>
+ <int key="maxID">15</int>
+ </object>
+ <object class="IBClassDescriber" key="IBDocument.Classes">
+ <object class="NSMutableArray" key="referencedPartialClassDescriptions">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBPartialClassDescription">
+ <string key="className">AssetPicker</string>
+ <string key="superclassName">UIViewController</string>
+ <object class="NSMutableDictionary" key="actions">
+ <string key="NS.key.0">dismiss:</string>
+ <string key="NS.object.0">id</string>
+ </object>
+ <object class="NSMutableDictionary" key="actionInfosByName">
+ <string key="NS.key.0">dismiss:</string>
+ <object class="IBActionInfo" key="NS.object.0">
+ <string key="name">dismiss:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="outlets">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>parent</string>
+ <string>scrollview</string>
+ <string>selectedAssetsLabel</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>id</string>
+ <string>UIScrollView</string>
+ <string>UILabel</string>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="toOneOutletInfosByName">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>parent</string>
+ <string>scrollview</string>
+ <string>selectedAssetsLabel</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBToOneOutletInfo">
+ <string key="name">parent</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBToOneOutletInfo">
+ <string key="name">scrollview</string>
+ <string key="candidateClassName">UIScrollView</string>
+ </object>
+ <object class="IBToOneOutletInfo">
+ <string key="name">selectedAssetsLabel</string>
+ <string key="candidateClassName">UILabel</string>
+ </object>
+ </object>
+ </object>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">Classes/ELCImagePickerController.h</string>
+ </object>
+ </object>
+ </object>
+ <object class="NSMutableArray" key="referencedPartialClassDescriptionsV3.2+">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSError.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSFileManager.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSKeyValueCoding.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSKeyValueObserving.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSKeyedArchiver.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSObject.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSRunLoop.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSThread.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSURL.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSURLConnection.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UIAccessibility.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UINibLoading.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier" id="945039026">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UIResponder.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UILabel</string>
+ <string key="superclassName">UIView</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UILabel.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UIResponder</string>
+ <string key="superclassName">NSObject</string>
+ <reference key="sourceIdentifier" ref="945039026"/>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UIScrollView</string>
+ <string key="superclassName">UIView</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UIScrollView.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UISearchBar</string>
+ <string key="superclassName">UIView</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UISearchBar.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UISearchDisplayController</string>
+ <string key="superclassName">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UISearchDisplayController.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UIView</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UITextField.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UIView</string>
+ <string key="superclassName">UIResponder</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UIView.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UIViewController</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UINavigationController.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UIViewController</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UIPopoverController.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UIViewController</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UISplitViewController.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UIViewController</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UITabBarController.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UIViewController</string>
+ <string key="superclassName">UIResponder</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UIViewController.h</string>
+ </object>
+ </object>
+ </object>
+ </object>
+ <int key="IBDocument.localizationMode">0</int>
+ <string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencyDefaults">
+ <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS</string>
+ <integer value="1024" key="NS.object.0"/>
+ </object>
+ <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
+ <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3</string>
+ <integer value="3000" key="NS.object.0"/>
+ </object>
+ <bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
+ <string key="IBDocument.LastKnownRelativeProjectPath">../ELCImagePickerDemo.xcodeproj</string>
+ <int key="IBDocument.defaultPropertyAccessControl">3</int>
+ <string key="IBCocoaTouchPluginVersion">123</string>
+ </data>
+</archive>
View
33 Classes/ELCAssetTablePicker.h
@@ -0,0 +1,33 @@
+//
+// AssetTablePicker.h
+//
+// Created by Matt Tuzzolo on 2/15/11.
+// Copyright 2011 ELC Technologies. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+#import <AssetsLibrary/AssetsLibrary.h>
+
+@interface ELCAssetTablePicker : UITableViewController
+{
+ ALAssetsGroup *assetGroup;
+
+ NSMutableArray *elcAssets;
+ int selectedAssets;
+
+ id parent;
+
+ NSOperationQueue *queue;
+}
+
+@property (nonatomic, assign) id parent;
+@property (nonatomic, assign) ALAssetsGroup *assetGroup;
+@property (nonatomic, retain) NSMutableArray *elcAssets;
+@property (nonatomic, retain) IBOutlet UILabel *selectedAssetsLabel;
+
+-(int)totalSelectedAssets;
+-(void)preparePhotos;
+
+-(void)doneAction:(id)sender;
+
+@end
View
178 Classes/ELCAssetTablePicker.m
@@ -0,0 +1,178 @@
+//
+// AssetTablePicker.m
+//
+// Created by Matt Tuzzolo on 2/15/11.
+// Copyright 2011 ELC Technologies. All rights reserved.
+//
+
+#import "ELCAssetTablePicker.h"
+#import "ELCAssetCell.h"
+#import "ELCAsset.h"
+#import "ELCAlbumPickerController.h"
+
+
+@implementation ELCAssetTablePicker
+
+@synthesize parent;
+@synthesize selectedAssetsLabel;
+@synthesize assetGroup, elcAssets;
+
+-(void)viewDidLoad {
+
+ [self.tableView setSeparatorColor:[UIColor clearColor]];
+ [self.tableView setAllowsSelection:NO];
+
+ NSMutableArray *tempArray = [[NSMutableArray alloc] init];
+ self.elcAssets = tempArray;
+ [tempArray release];
+
+ UIBarButtonItem *doneButtonItem = [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(doneAction:)] autorelease];
+ [self.navigationItem setRightBarButtonItem:doneButtonItem];
+ [self.navigationItem setTitle:@"Loading..."];
+
+ [self performSelectorInBackground:@selector(preparePhotos) withObject:nil];
+
+ // Show partial while full list loads
+ [self.tableView performSelector:@selector(reloadData) withObject:nil afterDelay:.5];
+}
+
+-(void)preparePhotos {
+
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+
+
+ NSLog(@"enumerating photos");
+ [self.assetGroup enumerateAssetsUsingBlock:^(ALAsset *result, NSUInteger index, BOOL *stop)
+ {
+ if(result == nil)
+ {
+ return;
+ }
+
+ ELCAsset *elcAsset = [[[ELCAsset alloc] initWithAsset:result] autorelease];
+ [elcAsset setParent:self];
+ [self.elcAssets addObject:elcAsset];
+ }];
+ NSLog(@"done enumerating photos");
+
+ [self.tableView reloadData];
+ [self.navigationItem setTitle:@"Pick Photos"];
+
+ [pool release];
+
+}
+
+- (void) doneAction:(id)sender {
+
+ NSMutableArray *selectedAssetsImages = [[[NSMutableArray alloc] init] autorelease];
+
+ for(ELCAsset *elcAsset in self.elcAssets)
+ {
+ if([elcAsset selected]) {
+
+ [selectedAssetsImages addObject:[elcAsset asset]];
+ }
+ }
+
+ [(ELCAlbumPickerController*)self.parent selectedAssets:selectedAssetsImages];
+}
+
+#pragma mark UITableViewDataSource Delegate Methods
+
+- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
+ // Return the number of sections.
+ return 1;
+}
+
+
+- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
+ return ceil([self.assetGroup numberOfAssets] / 4.0);
+}
+
+// ugly
+-(NSArray*)assetsForIndexPath:(NSIndexPath*)_indexPath {
+
+ int index = (_indexPath.row*4);
+ int maxIndex = (_indexPath.row*4+3);
+
+ // NSLog(@"Getting assets for %d to %d with array count %d", index, maxIndex, [assets count]);
+
+ if(maxIndex < [self.elcAssets count]) {
+
+ return [NSArray arrayWithObjects:[self.elcAssets objectAtIndex:index],
+ [self.elcAssets objectAtIndex:index+1],
+ [self.elcAssets objectAtIndex:index+2],
+ [self.elcAssets objectAtIndex:index+3],
+ nil];
+ }
+
+ else if(maxIndex-1 < [self.elcAssets count]) {
+
+ return [NSArray arrayWithObjects:[self.elcAssets objectAtIndex:index],
+ [self.elcAssets objectAtIndex:index+1],
+ [self.elcAssets objectAtIndex:index+2],
+ nil];
+ }
+
+ else if(maxIndex-2 < [self.elcAssets count]) {
+
+ return [NSArray arrayWithObjects:[self.elcAssets objectAtIndex:index],
+ [self.elcAssets objectAtIndex:index+1],
+ nil];
+ }
+
+ else if(maxIndex-3 < [self.elcAssets count]) {
+
+ return [NSArray arrayWithObject:[self.elcAssets objectAtIndex:index]];
+ }
+
+ return nil;
+}
+
+// Customize the appearance of table view cells.
+- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
+
+ static NSString *CellIdentifier = @"Cell";
+
+ ELCAssetCell *cell = (ELCAssetCell*)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
+
+ if (cell == nil)
+ {
+ cell = [[[ELCAssetCell alloc] initWithAssets:[self assetsForIndexPath:indexPath] reuseIdentifier:CellIdentifier] autorelease];
+ }
+ else
+ {
+ [cell setAssets:[self assetsForIndexPath:indexPath]];
+ }
+
+ return cell;
+}
+
+- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
+
+ return 79;
+}
+
+- (int)totalSelectedAssets {
+
+ int count = 0;
+
+ for(ELCAsset *asset in self.elcAssets)
+ {
+ if([asset selected])
+ {
+ count++;
+ }
+ }
+
+ return count;
+}
+
+- (void)dealloc
+{
+ [elcAssets release];
+ [selectedAssetsLabel release];
+ [super dealloc];
+}
+
+@end
View
4 Classes/AssetTablePicker.xib → Classes/ELCAssetTablePicker.xib
@@ -44,7 +44,7 @@
<reference key="NSSuperview"/>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
- <bytes key="NSWhite">MSAwAA</bytes>
+ <bytes key="NSWhite">MQA</bytes>
</object>
<bool key="IBUIClipsSubviews">YES</bool>
<object class="IBUISimulatedNavigationBarMetrics" key="IBUISimulatedTopBarMetrics">
@@ -128,7 +128,7 @@
<bool key="EncodedWithXMLCoder">YES</bool>
<string>AssetTablePicker</string>
<string>UIResponder</string>
- <string>{{0, 676}, {320, 480}}</string>
+ <string>{{0, 526}, {320, 480}}</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</object>
</object>
View
62 Classes/ELCImagePickerController.h
@@ -7,7 +7,6 @@
//
#import <UIKit/UIKit.h>
-#import <AssetsLibrary/AssetsLibrary.h>
@interface ELCImagePickerController : UINavigationController {
@@ -18,67 +17,6 @@
-(void)selectedAssets:(NSArray*)_assets;
-(void)cancelImagePicker;
--(id)initImagePicker;
-
-@end
-
-@interface AlbumPickerController : UITableViewController {
-
- NSMutableArray *assetGroups;
- NSOperationQueue *queue;
- id parent;
-}
-
-@property (nonatomic, assign) id parent;
-
--(void)preparePhotos;
--(void)selectedAssets:(NSArray*)_assets;
-
-@end
-
-@interface AssetTablePicker : UITableViewController
-{
- ALAssetsGroup *assetGroup;
-
- NSMutableArray *assets;
- NSMutableArray *assetURLDictionaries;
- int selectedAssets;
-
- id parent;
-
- NSOperationQueue *queue;
-}
-
-@property (nonatomic, retain) IBOutlet UILabel *selectedAssetsLabel;
-@property (nonatomic, assign) id parent;
-
--(void)setAssetsGroup:(ALAssetsGroup*)_group;
--(IBAction)dismiss:(id)sender;
-
-@end
-
-@interface AssetCell : UITableViewCell
-{
- NSArray *assets;
-}
-
--(id)initWithAssets:(NSArray*)_assets reuseIdentifier:(NSString*)_identifier;
--(void)setAssets:(NSArray*)_assets;
-
-@end
-
-@interface Asset : UIView {
- ALAsset *asset;
- UIImageView *overlayView;
- BOOL selected;
- id parent;
-}
-
-@property (nonatomic, retain) ALAsset *asset;
-@property (nonatomic, assign) id parent;
-
--(id)initWithAsset:(ALAsset*)_asset;
--(BOOL)selected;
@end
View
430 Classes/ELCImagePickerController.m
@@ -7,26 +7,17 @@
//
#import "ELCImagePickerController.h"
+#import "ELCAsset.h"
+#import "ELCAssetCell.h"
+#import "ELCAssetTablePicker.h"
+#import "ELCAlbumPickerController.h"
@implementation ELCImagePickerController
@synthesize delegate;
--(id)initImagePicker {
-
- if(self = [super init]) {
- AlbumPickerController *albumController = [[AlbumPickerController alloc] initWithNibName:@"AlbumPickerController" bundle:[NSBundle mainBundle]];
- [albumController setParent:self];
-
- [super initWithRootViewController:albumController];
- [albumController release];
- }
-
- return self;
-}
-
-(void)cancelImagePicker {
-
+
if([delegate respondsToSelector:@selector(elcImagePickerControllerDidCancel:)]) {
[delegate performSelector:@selector(elcImagePickerControllerDidCancel:) withObject:self];
}
@@ -34,13 +25,13 @@ -(void)cancelImagePicker {
-(void)selectedAssets:(NSArray*)_assets {
- NSMutableArray *returnArray = [[NSMutableArray alloc] init];
+ NSMutableArray *returnArray = [[[NSMutableArray alloc] init] autorelease];
for(ALAsset *asset in _assets) {
NSMutableDictionary *workingDictionary = [[NSMutableDictionary alloc] init];
[workingDictionary setObject:[asset valueForProperty:ALAssetPropertyType] forKey:@"UIImagePickerControllerMediaType"];
- [workingDictionary setObject:[UIImage imageWithCGImage:[[asset defaultRepresentation] fullScreenImage]] forKey:@"UIImagePickerControllerOriginalImage"];
+ [workingDictionary setObject:[UIImage imageWithCGImage:[[asset defaultRepresentation] fullScreenImage] scale:1.0 orientation:[[asset valueForProperty:@"ALAssetPropertyOrientation"] intValue]] forKey:@"UIImagePickerControllerOriginalImage"];
[workingDictionary setObject:[[asset valueForProperty:ALAssetPropertyURLs] valueForKey:[[[asset valueForProperty:ALAssetPropertyURLs] allKeys] objectAtIndex:0]] forKey:@"UIImagePickerControllerReferenceURL"];
[returnArray addObject:workingDictionary];
@@ -48,6 +39,9 @@ -(void)selectedAssets:(NSArray*)_assets {
[workingDictionary release];
}
+ [self popToRootViewControllerAnimated:NO];
+ [[self parentViewController] dismissModalViewControllerAnimated:YES];
+
if([delegate respondsToSelector:@selector(elcImagePickerController:didFinishPickingMediaWithInfo:)]) {
[delegate performSelector:@selector(elcImagePickerController:didFinishPickingMediaWithInfo:) withObject:self withObject:[NSArray arrayWithArray:returnArray]];
}
@@ -56,415 +50,19 @@ -(void)selectedAssets:(NSArray*)_assets {
#pragma mark -
#pragma mark Memory management
-- (void)didReceiveMemoryWarning {
- // Releases the view if it doesn't have a superview.
- [super didReceiveMemoryWarning];
-
- // Release any cached data, images, etc that aren't in use.
-}
-
-- (void)viewDidUnload {
- [super viewDidUnload];
-}
-
-
-- (void)dealloc {
- [super dealloc];
-}
-
-@end
-
-@implementation AlbumPickerController
-
-@synthesize parent;
-
-#pragma mark -
-#pragma mark View lifecycle
-
-- (void)viewDidLoad {
- [super viewDidLoad];
-
- [self.navigationItem setTitle:@"Loading..."];
-
-// queue = [NSOperationQueue mainQueue];
-// NSInvocationOperation *operation = [[NSInvocationOperation alloc] initWithTarget:self selector:@selector(preparePhotos) object:nil];
-// [queue addOperation:operation];
-
- [self performSelectorInBackground:@selector(preparePhotos) withObject:nil];
-
- UIBarButtonItem *cancelButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(dismiss:)];
- [self.navigationItem setRightBarButtonItem:cancelButton];
- [cancelButton release];
-}
-
--(void)dismiss:(id)sender {
-
- [parent cancelImagePicker];
-}
-
--(void)preparePhotos {
-
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-
- void (^assetGroupEnumerator)(struct ALAssetsGroup *, BOOL *) = ^(ALAssetsGroup *group, BOOL *stop) {
- if(group != nil) {
- [assetGroups addObject:group];
- NSLog(@"Number of assets in group %d", [group numberOfAssets]);
- }
-
- [self performSelectorOnMainThread:@selector(reloadTableView) withObject:nil waitUntilDone:NO];
- };
-
- assetGroups = [[NSMutableArray alloc] init];
-
- ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init];
- [library enumerateGroupsWithTypes:ALAssetsGroupAll
- usingBlock:assetGroupEnumerator
- failureBlock:^(NSError *error) {
- NSLog(@"A problem occured");
- }];
- [library release];
- [pool release];
-}
-
--(void)reloadTableView {
-
- [self.tableView reloadData];
- [self.navigationItem setTitle:@"Select an Album"];
-}
-
--(void)selectedAssets:(NSArray*)_assets {
-
- [(ELCImagePickerController*)parent selectedAssets:_assets];
-}
-
-#pragma mark -
-#pragma mark Table view data source
-
-- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
- // Return the number of sections.
- return 1;
-}
-
-
-- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
- // Return the number of rows in the section.
- return [assetGroups count];
-}
-
-
-// Customize the appearance of table view cells.
-- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
-
- static NSString *CellIdentifier = @"Cell";
+- (void)didReceiveMemoryWarning {
+ NSLog(@"ELC Image Picker received memory warning!!!");
- UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
- if (cell == nil) {
- cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
- }
-
- cell.textLabel.text = [NSString stringWithFormat:@"%@ (%d)",[(ALAsset*)[assetGroups objectAtIndex:indexPath.row] valueForProperty:ALAssetsGroupPropertyName], [(ALAssetsGroup*)[assetGroups objectAtIndex:indexPath.row] numberOfAssets]];
- [cell.imageView setImage:[UIImage imageWithCGImage:[(ALAssetsGroup*)[assetGroups objectAtIndex:indexPath.row] posterImage]]];
- [cell setAccessoryType:UITableViewCellAccessoryDisclosureIndicator];
-
- return cell;
-}
-
-#pragma mark -
-#pragma mark Table view delegate
-
-- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
-
- AssetTablePicker *picker = [[AssetTablePicker alloc] initWithNibName:@"AssetTablePicker" bundle:[NSBundle mainBundle]];
- [picker setParent:self];
- [picker setAssetsGroup:[assetGroups objectAtIndex:indexPath.row]];
- [self.navigationController pushViewController:picker animated:YES];
- [picker release];
-}
-
-- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
-
- return 57;
-}
-
-#pragma mark -
-#pragma mark Memory management
-
-- (void)didReceiveMemoryWarning {
- // Releases the view if it doesn't have a superview.
[super didReceiveMemoryWarning];
-
- // Relinquish ownership any cached data, images, etc that aren't in use.
}
- (void)viewDidUnload {
- // Relinquish ownership of anything that can be recreated in viewDidLoad or on demand.
- // For example: self.myOutlet = nil;
-}
-
-
-- (void)dealloc {
-
- [assetGroups release];
- [super dealloc];
-}
-
-@end
-
-@implementation AssetTablePicker
-
-@synthesize parent;
-@synthesize selectedAssetsLabel;
-
--(void)viewDidLoad {
-
- [self.tableView setSeparatorColor:[UIColor clearColor]];
- [self.tableView setAllowsSelection:NO];
-
- UIBarButtonItem *doneButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(dismiss:)];
- [self.navigationItem setRightBarButtonItem:doneButtonItem];
- [self.navigationItem setTitle:@"Loading..."];
-
- [self performSelectorInBackground:@selector(preparePhotos) withObject:nil];
-}
-
-- (void)setAssetsGroup:(ALAssetsGroup*)_group {
-
- assetGroup = _group;
-}
-
--(void)preparePhotos {
-
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-
- void (^assetEnumerator)(struct ALAsset *, NSUInteger, BOOL *) = ^(ALAsset *result, NSUInteger index, BOOL *stop) {
-
- if(result != nil) {
-
- if(![assetURLDictionaries containsObject:[result valueForProperty:ALAssetPropertyURLs]]) {
- if(![[result valueForProperty:ALAssetPropertyType] isEqualToString:ALAssetTypeVideo]) {
- [assetURLDictionaries addObject:[result valueForProperty:ALAssetPropertyURLs]];
- Asset *asset = [[Asset alloc] initWithAsset:result];
- [assets addObject:asset];
- }
- }
- }
- };
-
- assets = [[NSMutableArray alloc] init];
- assetURLDictionaries = [[NSMutableArray alloc] init];
-
- [assetGroup enumerateAssetsUsingBlock:assetEnumerator];
-
- [self.tableView reloadData];
- [self.navigationItem setTitle:@"Pick Photos"];
-
- [pool release];
-}
-
--(IBAction)dismiss:(id)sender {
-
- NSMutableArray *selectedAssetsImages = [[NSMutableArray alloc] init];
-
- for(Asset *asset in assets) {
-
- if([asset selected]) {
-
- [selectedAssetsImages addObject:[asset asset]];
- }
- }
-
- [(AlbumPickerController*)parent selectedAssets:[NSArray arrayWithArray:selectedAssetsImages]];
-}
-
--(NSArray*)assetsForIndexPath:(NSIndexPath*)_indexPath {
-
- int index = (_indexPath.row*4);
- int maxIndex = (_indexPath.row*4+3);
-
- NSLog(@"Getting assets for %d to %d with array count %d", index, maxIndex, [assets count]);
-
- if(maxIndex < [assets count]) {
-
- return [NSArray arrayWithObjects:[assets objectAtIndex:index],
- [assets objectAtIndex:index+1],
- [assets objectAtIndex:index+2],
- [assets objectAtIndex:index+3],
- nil];
- }
-
- else if(maxIndex-1 < [assets count]) {
-
- return [NSArray arrayWithObjects:[assets objectAtIndex:index],
- [assets objectAtIndex:index+1],
- [assets objectAtIndex:index+2],
- nil];
- }
-
- else if(maxIndex-2 < [assets count]) {
-
- return [NSArray arrayWithObjects:[assets objectAtIndex:index],
- [assets objectAtIndex:index+1],
- nil];
- }
-
- else if(maxIndex-3 < [assets count]) {
-
- return [NSArray arrayWithObject:[assets objectAtIndex:index]];
- }
-
- return nil;
-}
-
-#pragma mark UITableViewDataSource Delegate Methods
-
-- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
- // Return the number of sections.
- return 1;
-}
-
-
-- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
- // Return the number of rows in the section.
- return ceil([assets count]/4.0);
-}
-
-
-// Customize the appearance of table view cells.
-- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
-
- static NSString *CellIdentifier = @"Cell";
-
- AssetCell *cell = (AssetCell*)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
- if (cell == nil) {
-
- cell = [[[AssetCell alloc] initWithAssets:[self assetsForIndexPath:indexPath] reuseIdentifier:CellIdentifier] autorelease];
- }
-
- else {
-
- [cell setAssets:[self assetsForIndexPath:indexPath]];
- }
-
- return cell;
-}
-
-- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
-
- return 79;
-}
-
-- (void)dealloc {
-
- [super dealloc];
-}
-
-@end
-
-@implementation AssetCell
-
--(id)initWithAssets:(NSArray*)_assets reuseIdentifier:(NSString*)_identifier {
-
- if(self = [super initWithStyle:UITableViewStylePlain reuseIdentifier:_identifier]) {
-
- assets = _assets;
- [assets retain];
- }
-
- return self;
-}
-
--(void)setAssets:(NSArray*)_assets {
-
- for(UIView *view in [self subviews]) {
-
- [view removeFromSuperview];
- }
-
- assets = nil;
- assets = _assets;
- [assets retain];
-}
-
--(void)layoutSubviews {
-
- CGRect frame = CGRectMake(4, 2, 75, 75);
-
- for(Asset *asset in assets) {
-
- [asset setFrame:frame];
- [asset addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:asset action:@selector(toggleSelection)]];
- [self addSubview:asset];
-
- frame.origin.x = frame.origin.x + frame.size.width + 4;
- [asset release];
- }
-}
-
--(void)dealloc {
-
- [assets release];
- [super dealloc];
-}
-
-@end
-
-@implementation Asset
-
-@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)]) {
-
- asset = _asset;
- [asset retain];
-
- CGRect viewFrames = CGRectMake(0, 0, 75, 75);
-
- UIImageView *assetImageView = [[UIImageView alloc] initWithFrame:viewFrames];
- [assetImageView setContentMode:UIViewContentModeScaleToFill];
- [assetImageView setImage:[UIImage imageWithCGImage:[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;
-}
-
--(BOOL)selected {
-
- return !overlayView.hidden;
+ [super viewDidUnload];
}
--(void)setSelected:(BOOL)_selected {
-
- [overlayView setHidden:!_selected];
-}
- (void)dealloc {
-
- [asset release];
- [overlayView release];
+ NSLog(@"deallocing ELCImagePickerController");
[super dealloc];
}
View
16 Classes/ELCImagePickerDemoViewController.m
@@ -6,7 +6,10 @@
// Copyright 2010 ELC Technologies. All rights reserved.
//
+#import "ELCImagePickerDemoAppDelegate.h"
#import "ELCImagePickerDemoViewController.h"
+#import "ELCImagePickerController.h"
+#import "ELCAlbumPickerController.h"
@implementation ELCImagePickerDemoViewController
@@ -14,10 +17,15 @@ @implementation ELCImagePickerDemoViewController
-(IBAction)launchController {
- ELCImagePickerController *controller = [[ELCImagePickerController alloc] initImagePicker];
- [controller setDelegate:self];
- [self presentModalViewController:controller animated:YES];
- [controller release];
+ ELCAlbumPickerController *albumController = [[ELCAlbumPickerController alloc] initWithNibName:@"ELCAlbumPickerController" bundle:[NSBundle mainBundle]];
+ ELCImagePickerController *elcPicker = [[ELCImagePickerController alloc] initWithRootViewController:albumController];
+ [albumController setParent:elcPicker];
+ [elcPicker setDelegate:self];
+
+ ELCImagePickerDemoAppDelegate *app = (ELCImagePickerDemoAppDelegate *)[[UIApplication sharedApplication] delegate];
+ [app.viewController presentModalViewController:elcPicker animated:YES];
+ [elcPicker release];
+ [albumController release];
}
#pragma mark ELCImagePickerControllerDelegate Methods
View
101 ELCImagePickerDemo.xcodeproj/project.pbxproj
@@ -15,13 +15,18 @@
2899E5220DE3E06400AC0155 /* ELCImagePickerDemoViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2899E5210DE3E06400AC0155 /* ELCImagePickerDemoViewController.xib */; };
28AD733F0D9D9553002E5188 /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 28AD733E0D9D9553002E5188 /* MainWindow.xib */; };
28D7ACF80DDB3853001CB0EB /* ELCImagePickerDemoViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 28D7ACF70DDB3853001CB0EB /* ELCImagePickerDemoViewController.m */; };
- E24E7F451242EE0200A9717B /* AssetTablePicker.xib in Resources */ = {isa = PBXBuildFile; fileRef = E24E7F441242EE0200A9717B /* AssetTablePicker.xib */; };
- E29A5DA11239BDFA008BB149 /* ELCImagePickerController.m in Sources */ = {isa = PBXBuildFile; fileRef = E29A5D9F1239BDFA008BB149 /* ELCImagePickerController.m */; };
- E29A5DA21239BDFA008BB149 /* ELCImagePickerController.xib in Resources */ = {isa = PBXBuildFile; fileRef = E29A5DA01239BDFA008BB149 /* ELCImagePickerController.xib */; };
+ 8FBE5D99131DC988001603C7 /* ELCAlbumPickerController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8FBE5D89131DC988001603C7 /* ELCAlbumPickerController.m */; };
+ 8FBE5D9A131DC988001603C7 /* ELCAssetTablePicker.m in Sources */ = {isa = PBXBuildFile; fileRef = 8FBE5D8B131DC988001603C7 /* ELCAssetTablePicker.m */; };
+ 8FBE5D9B131DC988001603C7 /* ELCAsset.m in Sources */ = {isa = PBXBuildFile; fileRef = 8FBE5D8D131DC988001603C7 /* ELCAsset.m */; };
+ 8FBE5D9C131DC988001603C7 /* ELCAssetCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 8FBE5D8F131DC988001603C7 /* ELCAssetCell.m */; };
+ 8FBE5D9D131DC988001603C7 /* ELCImagePickerController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8FBE5D91131DC988001603C7 /* ELCImagePickerController.m */; };
+ 8FBE5D9E131DC988001603C7 /* ELCImagePickerController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 8FBE5D92131DC988001603C7 /* ELCImagePickerController.xib */; };
+ 8FBE5D9F131DC988001603C7 /* ELCAlbumPickerController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 8FBE5D94131DC988001603C7 /* ELCAlbumPickerController.xib */; };
+ 8FBE5DA0131DC988001603C7 /* ELCAssetTablePicker.xib in Resources */ = {isa = PBXBuildFile; fileRef = 8FBE5D95131DC988001603C7 /* ELCAssetTablePicker.xib */; };
+ 8FBE5DA1131DC988001603C7 /* ELCAssetPicker.xib in Resources */ = {isa = PBXBuildFile; fileRef = 8FBE5D96131DC988001603C7 /* ELCAssetPicker.xib */; };
+ 8FBE5DA2131DC988001603C7 /* Overlay.png in Resources */ = {isa = PBXBuildFile; fileRef = 8FBE5D97131DC988001603C7 /* Overlay.png */; };
+ 8FBE5DA3131DC988001603C7 /* Overlay@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 8FBE5D98131DC988001603C7 /* Overlay@2x.png */; };
E29A5E3C1239C42A008BB149 /* AssetsLibrary.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E29A5E3B1239C42A008BB149 /* AssetsLibrary.framework */; };
- E29A5EC31239C492008BB149 /* AlbumPickerController.xib in Resources */ = {isa = PBXBuildFile; fileRef = E29A5EC11239C492008BB149 /* AlbumPickerController.xib */; };
- E29A5FD2123AB3B8008BB149 /* Overlay.png in Resources */ = {isa = PBXBuildFile; fileRef = E29A5FD0123AB3B8008BB149 /* Overlay.png */; };
- E29A5FD3123AB3B8008BB149 /* Overlay@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E29A5FD1123AB3B8008BB149 /* Overlay@2x.png */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
@@ -31,21 +36,30 @@
1D6058910D05DD3D006BFB54 /* ELCImagePickerDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ELCImagePickerDemo.app; sourceTree = BUILT_PRODUCTS_DIR; };
1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
288765A40DF7441C002DB57D /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
- 2899E5210DE3E06400AC0155 /* ELCImagePickerDemoViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ELCImagePickerDemoViewController.xib; sourceTree = "<group>"; };
+ 2899E5210DE3E06400AC0155 /* ELCImagePickerDemoViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = ELCImagePickerDemoViewController.xib; path = ../ELCImagePickerDemoViewController.xib; sourceTree = "<group>"; };
28AD733E0D9D9553002E5188 /* MainWindow.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MainWindow.xib; sourceTree = "<group>"; };
28D7ACF60DDB3853001CB0EB /* ELCImagePickerDemoViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ELCImagePickerDemoViewController.h; sourceTree = "<group>"; };
28D7ACF70DDB3853001CB0EB /* ELCImagePickerDemoViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ELCImagePickerDemoViewController.m; sourceTree = "<group>"; };
29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
32CA4F630368D1EE00C91783 /* ELCImagePickerDemo_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ELCImagePickerDemo_Prefix.pch; sourceTree = "<group>"; };
8D1107310486CEB800E47090 /* ELCImagePickerDemo-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "ELCImagePickerDemo-Info.plist"; plistStructureDefinitionIdentifier = "com.apple.xcode.plist.structure-definition.iphone.info-plist"; sourceTree = "<group>"; };
- E24E7F441242EE0200A9717B /* AssetTablePicker.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = AssetTablePicker.xib; sourceTree = "<group>"; };
- E29A5D9E1239BDFA008BB149 /* ELCImagePickerController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ELCImagePickerController.h; sourceTree = "<group>"; };
- E29A5D9F1239BDFA008BB149 /* ELCImagePickerController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ELCImagePickerController.m; sourceTree = "<group>"; };
- E29A5DA01239BDFA008BB149 /* ELCImagePickerController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ELCImagePickerController.xib; sourceTree = "<group>"; };
+ 8FBE5D88131DC988001603C7 /* ELCAlbumPickerController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ELCAlbumPickerController.h; sourceTree = "<group>"; };
+ 8FBE5D89131DC988001603C7 /* ELCAlbumPickerController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ELCAlbumPickerController.m; sourceTree = "<group>"; };
+ 8FBE5D8A131DC988001603C7 /* ELCAssetTablePicker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ELCAssetTablePicker.h; sourceTree = "<group>"; };
+ 8FBE5D8B131DC988001603C7 /* ELCAssetTablePicker.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ELCAssetTablePicker.m; sourceTree = "<group>"; };
+ 8FBE5D8C131DC988001603C7 /* ELCAsset.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ELCAsset.h; sourceTree = "<group>"; };
+ 8FBE5D8D131DC988001603C7 /* ELCAsset.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ELCAsset.m; sourceTree = "<group>"; };
+ 8FBE5D8E131DC988001603C7 /* ELCAssetCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ELCAssetCell.h; sourceTree = "<group>"; };
+ 8FBE5D8F131DC988001603C7 /* ELCAssetCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ELCAssetCell.m; sourceTree = "<group>"; };
+ 8FBE5D90131DC988001603C7 /* ELCImagePickerController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ELCImagePickerController.h; sourceTree = "<group>"; };
+ 8FBE5D91131DC988001603C7 /* ELCImagePickerController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ELCImagePickerController.m; sourceTree = "<group>"; };
+ 8FBE5D92131DC988001603C7 /* ELCImagePickerController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ELCImagePickerController.xib; sourceTree = "<group>"; };
+ 8FBE5D94131DC988001603C7 /* ELCAlbumPickerController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ELCAlbumPickerController.xib; sourceTree = "<group>"; };
+ 8FBE5D95131DC988001603C7 /* ELCAssetTablePicker.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ELCAssetTablePicker.xib; sourceTree = "<group>"; };
+ 8FBE5D96131DC988001603C7 /* ELCAssetPicker.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ELCAssetPicker.xib; sourceTree = "<group>"; };
+ 8FBE5D97131DC988001603C7 /* Overlay.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Overlay.png; sourceTree = "<group>"; };
+ 8FBE5D98131DC988001603C7 /* Overlay@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Overlay@2x.png"; sourceTree = "<group>"; };
E29A5E3B1239C42A008BB149 /* AssetsLibrary.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AssetsLibrary.framework; path = System/Library/Frameworks/AssetsLibrary.framework; sourceTree = SDKROOT; };
- E29A5EC11239C492008BB149 /* AlbumPickerController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = AlbumPickerController.xib; sourceTree = "<group>"; };
- E29A5FD0123AB3B8008BB149 /* Overlay.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Overlay.png; sourceTree = "<group>"; };
- E29A5FD1123AB3B8008BB149 /* Overlay@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Overlay@2x.png"; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -66,11 +80,12 @@
080E96DDFE201D6D7F000001 /* Classes */ = {
isa = PBXGroup;
children = (
- E29A5D9B1239BDDA008BB149 /* ELC Image Picker */,
+ 8FBE5D87131DC988001603C7 /* ELC Image Picker */,
1D3623240D0F684500981E51 /* ELCImagePickerDemoAppDelegate.h */,
1D3623250D0F684500981E51 /* ELCImagePickerDemoAppDelegate.m */,
28D7ACF60DDB3853001CB0EB /* ELCImagePickerDemoViewController.h */,
28D7ACF70DDB3853001CB0EB /* ELCImagePickerDemoViewController.m */,
+ 2899E5210DE3E06400AC0155 /* ELCImagePickerDemoViewController.xib */,
);
path = Classes;
sourceTree = "<group>";
@@ -107,7 +122,6 @@
29B97317FDCFA39411CA2CEA /* Resources */ = {
isa = PBXGroup;
children = (
- 2899E5210DE3E06400AC0155 /* ELCImagePickerDemoViewController.xib */,
28AD733E0D9D9553002E5188 /* MainWindow.xib */,
8D1107310486CEB800E47090 /* ELCImagePickerDemo-Info.plist */,
);
@@ -125,20 +139,37 @@
name = Frameworks;
sourceTree = "<group>";
};
- E29A5D9B1239BDDA008BB149 /* ELC Image Picker */ = {
+ 8FBE5D87131DC988001603C7 /* ELC Image Picker */ = {
isa = PBXGroup;
children = (
- E29A5D9E1239BDFA008BB149 /* ELCImagePickerController.h */,
- E29A5D9F1239BDFA008BB149 /* ELCImagePickerController.m */,
- E29A5DA01239BDFA008BB149 /* ELCImagePickerController.xib */,
- E29A5EC11239C492008BB149 /* AlbumPickerController.xib */,
- E24E7F441242EE0200A9717B /* AssetTablePicker.xib */,
- E29A5FD0123AB3B8008BB149 /* Overlay.png */,
- E29A5FD1123AB3B8008BB149 /* Overlay@2x.png */,
+ 8FBE5D93131DC988001603C7 /* Resources */,
+ 8FBE5D88131DC988001603C7 /* ELCAlbumPickerController.h */,
+ 8FBE5D89131DC988001603C7 /* ELCAlbumPickerController.m */,
+ 8FBE5D8A131DC988001603C7 /* ELCAssetTablePicker.h */,
+ 8FBE5D8B131DC988001603C7 /* ELCAssetTablePicker.m */,
+ 8FBE5D8C131DC988001603C7 /* ELCAsset.h */,
+ 8FBE5D8D131DC988001603C7 /* ELCAsset.m */,
+ 8FBE5D8E131DC988001603C7 /* ELCAssetCell.h */,
+ 8FBE5D8F131DC988001603C7 /* ELCAssetCell.m */,
+ 8FBE5D90131DC988001603C7 /* ELCImagePickerController.h */,
+ 8FBE5D91131DC988001603C7 /* ELCImagePickerController.m */,
+ 8FBE5D92131DC988001603C7 /* ELCImagePickerController.xib */,
);
name = "ELC Image Picker";
sourceTree = "<group>";
};
+ 8FBE5D93131DC988001603C7 /* Resources */ = {
+ isa = PBXGroup;
+ children = (
+ 8FBE5D94131DC988001603C7 /* ELCAlbumPickerController.xib */,
+ 8FBE5D95131DC988001603C7 /* ELCAssetTablePicker.xib */,
+ 8FBE5D96131DC988001603C7 /* ELCAssetPicker.xib */,
+ 8FBE5D97131DC988001603C7 /* Overlay.png */,
+ 8FBE5D98131DC988001603C7 /* Overlay@2x.png */,
+ );
+ name = Resources;
+ sourceTree = "<group>";
+ };
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
@@ -164,6 +195,9 @@
/* Begin PBXProject section */
29B97313FDCFA39411CA2CEA /* Project object */ = {
isa = PBXProject;
+ attributes = {
+ ORGANIZATIONNAME = "ELC Technologies";
+ };
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "ELCImagePickerDemo" */;
compatibilityVersion = "Xcode 3.1";
developmentRegion = English;
@@ -190,11 +224,12 @@
files = (
28AD733F0D9D9553002E5188 /* MainWindow.xib in Resources */,
2899E5220DE3E06400AC0155 /* ELCImagePickerDemoViewController.xib in Resources */,
- E29A5DA21239BDFA008BB149 /* ELCImagePickerController.xib in Resources */,
- E29A5EC31239C492008BB149 /* AlbumPickerController.xib in Resources */,
- E29A5FD2123AB3B8008BB149 /* Overlay.png in Resources */,
- E29A5FD3123AB3B8008BB149 /* Overlay@2x.png in Resources */,
- E24E7F451242EE0200A9717B /* AssetTablePicker.xib in Resources */,
+ 8FBE5D9E131DC988001603C7 /* ELCImagePickerController.xib in Resources */,
+ 8FBE5D9F131DC988001603C7 /* ELCAlbumPickerController.xib in Resources */,
+ 8FBE5DA0131DC988001603C7 /* ELCAssetTablePicker.xib in Resources */,
+ 8FBE5DA1131DC988001603C7 /* ELCAssetPicker.xib in Resources */,
+ 8FBE5DA2131DC988001603C7 /* Overlay.png in Resources */,
+ 8FBE5DA3131DC988001603C7 /* Overlay@2x.png in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -208,7 +243,11 @@
1D60589B0D05DD56006BFB54 /* main.m in Sources */,
1D3623260D0F684500981E51 /* ELCImagePickerDemoAppDelegate.m in Sources */,
28D7ACF80DDB3853001CB0EB /* ELCImagePickerDemoViewController.m in Sources */,
- E29A5DA11239BDFA008BB149 /* ELCImagePickerController.m in Sources */,
+ 8FBE5D99131DC988001603C7 /* ELCAlbumPickerController.m in Sources */,
+ 8FBE5D9A131DC988001603C7 /* ELCAssetTablePicker.m in Sources */,
+ 8FBE5D9B131DC988001603C7 /* ELCAsset.m in Sources */,
+ 8FBE5D9C131DC988001603C7 /* ELCAssetCell.m in Sources */,
+ 8FBE5D9D131DC988001603C7 /* ELCImagePickerController.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -251,7 +290,7 @@
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
PREBINDING = NO;
- SDKROOT = iphoneos4.1;
+ SDKROOT = iphoneos;
};
name = Debug;
};
Please sign in to comment.
Something went wrong with that request. Please try again.