tratar radiacion parche para oms electrosensibilidad como celulares bloqueador anti iphone ios email locking mfmailcomposeviewcontroller
Encuentre Framework & Art aquí

iphone - radiacion - Bloquear los campos en MFMailComposeViewController



electrosensibilidad oms (1)

Descargue el marco desde el siguiente enlace. Luego, armé un código que envía el correo electrónico con una buena superposición "por favor espere". He adjuntado una imagen de lo que parece mientras se está ejecutando (durante los pocos segundos que lleva). Tenga en cuenta que no me atribuyo ningún crédito por crear el marco SMTP. Fue descargado de Internet después de buscarlo para siempre. El archivo comprimido que puede descargar incluye las imágenes superpuestas que creé para los comentarios de los usuarios. Tiene tanto @ 2x como regular. Tendrás que ir al constructor de interfaz y crear la etiqueta que dice "enviar prueba de disco ...". Ya está en el código pero no lo agregué desde el código. Así que tendrás que agregarlo en IB.

1. Asegúrese de agregar el marco que descargó a su proyecto.

2. Asegúrese de agregar el marco CFNetwork a su proyecto

3. Asegúrese de adjuntar el nombre de UILabel "cargando etiqueta" en el constructor de interfaz

4. El nombre de usuario y la contraseña a los que hace referencia el código son un servidor smtp. Si no tiene uno, cree una cuenta de Gmail y use la configuración de gmail. Si no está familiarizado con la configuración de gmail google "gmail smtp", encontrará lo que necesita.

Encuentre Framework & Art aquí

Para su archivo .h, asegúrese de incluir:

//for sending email alert UIActivityIndicatorView * spinner; UIImageView * bgimage; IBOutlet UILabel * loadingLabel; } @property (nonatomic, retain)IBOutlet UILabel * loadingLabel; @property (nonatomic, retain)UIImageView * bgimage; @property (nonatomic, retain)UIActivityIndicatorView * spinner; -(void)sendEmail; -(void)removeWaitOverlay; -(void)createWaitOverlay; -(void)stopSpinner; -(void)startSpinner;

Para su archivo .m incluya:

@synthesize bgimage,spinner,loadingLabel; // add this in ViewDidLoad //set loading label to alpha 0 so its not displayed loadingLabel.alpha = 0;

todo lo demás es su propia función

-(void)sendEmail { // create soft wait overlay so the user knows whats going on in the background. [self createWaitOverlay]; //the guts of the message. SKPSMTPMessage *testMsg = [[SKPSMTPMessage alloc] init]; testMsg.fromEmail = @"[email protected]"; testMsg.toEmail = @"[email protected]"; testMsg.relayHost = @"smtpout.yourserver.net"; testMsg.requiresAuth = YES; testMsg.login = @"[email protected]"; testMsg.pass = @"yourPassWord"; testMsg.subject = @"This is the email subject line"; testMsg.wantsSecure = YES; // smtp.gmail.com doesn''t work without TLS! // Only do this for self-signed certs! // testMsg.validateSSLChain = NO; testMsg.delegate = self; //email contents NSString * bodyMessage = [NSString stringWithFormat:@"This is the body of the email. You can put anything in here that you want."]; NSDictionary *plainPart = [NSDictionary dictionaryWithObjectsAndKeys:@"text/plain",kSKPSMTPPartContentTypeKey, bodyMessage ,kSKPSMTPPartMessageKey,@"8bit",kSKPSMTPPartContentTransferEncodingKey,nil]; testMsg.parts = [NSArray arrayWithObjects:plainPart,nil]; [testMsg send]; } - (void)messageSent:(SKPSMTPMessage *)message { [message release]; //message has been successfully sent . you can notify the user of that and remove the wait overlay [self removeWaitOverlay]; UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Message Sent" message:@"Thanks, we have sent your message" delegate:self cancelButtonTitle:@"OK" otherButtonTitles: nil]; [alert show]; [alert release]; } - (void)messageFailed:(SKPSMTPMessage *)message error:(NSError *)error { [message release]; [self removeWaitOverlay]; NSLog(@"delegate - error(%d): %@", [error code], [error localizedDescription]); UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Email Error" message:@"Sending Failed - Unknown Error :-(" delegate:self cancelButtonTitle:@"OK" otherButtonTitles: nil]; [alert show]; [alert release]; } -(void)createWaitOverlay { // fade the overlay in loadingLabel = @"Sending Test Drive..."; bgimage = [[UIImageView alloc] initWithFrame:CGRectMake(0,0,320,480)]; bgimage.image = [UIImage imageNamed:@"waitOverLay.png"]; [self.view addSubview:bgimage]; bgimage.alpha = 0; [bgimage addSubview:loadingLabel]; loadingLabel.alpha = 0; [UIView beginAnimations: @"Fade In" context:nil]; [UIView setAnimationDelay:0]; [UIView setAnimationDuration:.5]; bgimage.alpha = 1; loadingLabel.alpha = 1; [UIView commitAnimations]; [self startSpinner]; [bgimage release]; } -(void)removeWaitOverlay { //fade the overlay out [UIView beginAnimations: @"Fade Out" context:nil]; [UIView setAnimationDelay:0]; [UIView setAnimationDuration:.5]; bgimage.alpha = 0; loadingLabel.alpha = 0; [UIView commitAnimations]; [self stopSpinner]; } -(void)startSpinner { spinner = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge]; spinner.hidden = FALSE; spinner.frame = CGRectMake(137, 160, 50, 50); [spinner setHidesWhenStopped:YES]; [self.view addSubview:spinner]; [self.view bringSubviewToFront:spinner]; [spinner startAnimating]; } -(void)stopSpinner { [spinner stopAnimating]; [spinner removeFromSuperview]; [spinner release]; }

Los resultados finales se muestran a continuación. La pantalla parece atenuarse un poco (algo así como cuando se muestra un UIAlert). Muestra un mensaje que dice que se envía, y luego "ilumina" una copia de seguridad cuando se envía el mensaje.

Happy Coding !!

¿Es posible bloquear de alguna manera los campos en un MFMailComposeViewController para que el cuerpo, los destinatarios, etc. no puedan ser cambiados por el usuario? Necesito el correo electrónico que envía el usuario para ir a una cuenta en particular y el cuerpo cumple con ciertos criterios, por lo que si el usuario edita drásticamente el formato, todo podría ir horriblemente mal ... En el momento en que el cuerpo se completa con los datos que el usuario entradas a campos de texto y selectores de fechas en la vista anterior.

Básicamente, creo que sería más profesional tener los campos bloqueados en lugar de mostrar una alerta o algo que diga "Por favor, no edite el mensaje", por lo que no es un gran problema si los campos no se pueden bloquear, pero cualquier ayuda sería muy apreciado.