iOS Programming
Objective C + iOS
Profile
Ankit Desai
 Ph.D. Scholar, IET, Ahmedabad University
 Education: M. Tech. CE, B.E. I. T.
 Experience: 7.5 Years (Academic and Research)
 Research Interest: IoT, Big Data Analytics,
Machine Learning, Data Mining.
UIImageView Control
 Drag a UIImageView and button on xib
UIImageView
Button
- (IBAction)clicked:(id)sender {
PicController=[[UIImagePickerController alloc]init];
PicController.sourceType=UIImagePickerControllerCameraCaptureModePhoto;
PicController.delegate=self;
[self presentViewController:PicController animated:YES completion:nil];
}
- (void)imagePickerController:(UIImagePickerController *)picker
didFinishPickingMediaWithInfo:(NSDictionary *)info
{
[self dismissViewControllerAnimated:YES completion:nil];
UIImage *img=info[UIImagePickerControllerOriginalImage];
imgview.image=img;
}
Add following methods
@synthesize imgview;
Output
Output
Thank you
 For further communication or queries:
 Contact me:
 desaiankitb@gmail.com
 www.fb.com/desaiankitb

Presentation6 ui image_view

  • 1.
  • 2.
    Profile Ankit Desai  Ph.D.Scholar, IET, Ahmedabad University  Education: M. Tech. CE, B.E. I. T.  Experience: 7.5 Years (Academic and Research)  Research Interest: IoT, Big Data Analytics, Machine Learning, Data Mining.
  • 3.
    UIImageView Control  Draga UIImageView and button on xib
  • 4.
  • 6.
    - (IBAction)clicked:(id)sender { PicController=[[UIImagePickerControlleralloc]init]; PicController.sourceType=UIImagePickerControllerCameraCaptureModePhoto; PicController.delegate=self; [self presentViewController:PicController animated:YES completion:nil]; } - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { [self dismissViewControllerAnimated:YES completion:nil]; UIImage *img=info[UIImagePickerControllerOriginalImage]; imgview.image=img; } Add following methods @synthesize imgview;
  • 7.
  • 8.
  • 9.
    Thank you  Forfurther communication or queries:  Contact me:  desaiankitb@gmail.com  www.fb.com/desaiankitb

Editor's Notes

  • #6 Declare IBOutlet, IBAction and UIImagePickerController in .h file