IOS-camara
-
Upload
aiko-tamashiro -
Category
Documents
-
view
180 -
download
2
description
Transcript of IOS-camara
![Page 1: IOS-camara](https://reader035.fdocuments.ec/reader035/viewer/2022073116/555e9e42d8b42a0d738b59aa/html5/thumbnails/1.jpg)
IOS Cámara
![Page 2: IOS-camara](https://reader035.fdocuments.ec/reader035/viewer/2022073116/555e9e42d8b42a0d738b59aa/html5/thumbnails/2.jpg)
Arquitectura IOS
•Basada en capas.▫Cocoa Touch▫Media▫Core Services▫Core OS
![Page 3: IOS-camara](https://reader035.fdocuments.ec/reader035/viewer/2022073116/555e9e42d8b42a0d738b59aa/html5/thumbnails/3.jpg)
ARQUITECTURA DE COCOA-TOUCH
• Esta arquitectura (Modelo-Vista-Controlador) separa los datos, interfaz de usuario y lógica de control en tres componentes. Para el caso del iOS SDK podemos ver la arquitectura de la siguiente manera :
CoreData (Modelo)UIView (Vista)UIViewController (Controlador)
![Page 4: IOS-camara](https://reader035.fdocuments.ec/reader035/viewer/2022073116/555e9e42d8b42a0d738b59aa/html5/thumbnails/4.jpg)
UIImagePickerController
•Para acceder a las imágenes guardadas en el dispositivo o capturar imágenes desde un iPhone se utilizara el controlador UIImagePickerController. Esta clase controla la interface de usuario y retorna el mensaje una vez terminada su utilización.
![Page 5: IOS-camara](https://reader035.fdocuments.ec/reader035/viewer/2022073116/555e9e42d8b42a0d738b59aa/html5/thumbnails/5.jpg)
Código de agregar elementos:
#import <UIKit/UIKit.h> @interface ViewController : UIViewController
<UIImagePickerControllerDelegate, UINavigationControllerDelegate> {
UIImageView *imagenView; UIButton *abrirGaleria; UIButton *tomarFoto; } @property (nonatomic, retain) IBOutlet UIImageView *imagenView; @property (nonatomic, retain) IBOutlet UIButton *abrirGaleria; @property (nonatomic, retain) IBOutlet UIButton *tomarFoto;
- (IBAction)abrirGaleria:(id)sender; - (IBAction)tomarFoto:(id)sender;
@end
![Page 6: IOS-camara](https://reader035.fdocuments.ec/reader035/viewer/2022073116/555e9e42d8b42a0d738b59aa/html5/thumbnails/6.jpg)
Crear interfaz y enlazar:
![Page 7: IOS-camara](https://reader035.fdocuments.ec/reader035/viewer/2022073116/555e9e42d8b42a0d738b59aa/html5/thumbnails/7.jpg)
Crear interfaz y enlazar:
![Page 8: IOS-camara](https://reader035.fdocuments.ec/reader035/viewer/2022073116/555e9e42d8b42a0d738b59aa/html5/thumbnails/8.jpg)
Funciones declaradas previamente
#import "ViewController.h" @implementation ViewController @synthesize imagenView, abrirGaleria, tomarFoto;
- (IBAction)abrirGaleria:(id)sender {…..}
- (IBAction)tomarFoto:(id)sender {…..}
![Page 9: IOS-camara](https://reader035.fdocuments.ec/reader035/viewer/2022073116/555e9e42d8b42a0d738b59aa/html5/thumbnails/9.jpg)
Cerrar
- (void)dealloc { [imagenView release];[abrirGaleria release]; [tomarFoto release]; [super dealloc];
}