5/27/2009

UIImageViewController


Getting images from your photo library is as easy as about... 10 lines of code. I was pretty impressed how the API made it so easy. I'm putting in some player profile picture feature in there.

写真アルバムから写真をゲットすんのにめちゃくちゃ簡単なことにびっくり。
ステータスに自分の写真を入れれるようにした。


@interface StatusViewController : UIViewController <UIImagePickerControllerDelegate, UINavigationControllerDelegate> {



- (IBAction)showImagePicker:(id)sender
{
UIImagePickerController *imagePickerController = [[UIImagePickerController alloc] init];
imagePickerController.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
imagePickerController.delegate = self;
imagePickerController.allowsImageEditing = YES;
[self presentModalViewController:imagePickerController animated:YES];
[imagePickerController release];
}

- (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker
{
[self dismissModalViewControllerAnimated:YES];
}

3 comments:

  1. hey thanks.. amazing how little code there is for this component out there :)

    ReplyDelete
  2. Glad to be help!
    Yeah, this UIImageViewController was a huge surprise for me too.

    ReplyDelete
  3. THANKSSSSSSSSSSS

    ReplyDelete