Search code examples
iphonesecurityios4photo

Best way to make a "Photo Vault" app


I really wanted to try to make an app that stores photos and is password protected, much like the other apps out there. IE. My eyes only, etc. I am not asking anyone here to give me step by step instructions on how to make one (would be nice though ;). What I am asking is where should I even begin? I would like to use the split view controller, and Ive been trying to get those to work. Thanks in advance,

Tate


Solution

  • from a high level.. here are some items I would think about...

    where will you store the images? Server, Local? if local, where you will you store the images? IOS Photo Library or your app directory?

    next, how will you display the images? iphone does not have a multi-column multi row photo thumbnail viewer out of the box (that Im aware of).. hence you will need to roll you own based on a UIScrollView

    I would also want to have the ability to page from image to image in full screen mode, that too would be done with a UIScrollView, paging enabled,each page holding another UIScrollView (for zooming and panning) that holds the imageview.

    next on my list would be memory management. if Im showing multiple images on page, there is no way I could render the original images, nor would I care to load them, so each image would need to have a thumbnail rendered and stored. there is good code out there on resizing an image.

    next is the issue of capturing the image.. the UIImagePickerController will be your controller there.

    next is the issue of the password. If you are semi serious about protecting it.. storing it in the keychain is your choice. If its just a simple pin and who really cares if its hacked.. then just store it in NSUserDefaults.

    here is the code to read an image for your doc directory

                    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); 
                    NSString *docDir = [paths objectAtIndex:0];
                    NSString *path = [[NSString alloc]initWithFormat: @"%@/%@",docDir,name];
    
                    NSMutableData *data = [[NSMutableData alloc] initWithContentsOfFile:path];
    
                    if(data)
                    {
                        image = [UIImage imageWithData:data];   
                    }
    
                    [data release];
                    [path release];
    

    and from here, Im sure there is a ton more you could do.. but its at least a good starting point.