Cómo mostrar un mensaje en iOS que tiene la misma funcionalidad que Toast en Android

Necesito saber si hay algún método en iOS que se comporte como los mensajes de Toast en Android. Es decir, necesito mostrar un mensaje que se descarta automáticamente después de algunos segundos. Esto es similar a la funcionalidad de la clase Toast en el entorno de Android.

13 Solutions collect form web for “Cómo mostrar un mensaje en iOS que tiene la misma funcionalidad que Toast en Android”

Puede utilizar el proyecto MBProgressHUD .

Utilice el modo HUD MBProgressHUDModeText para el comportamiento de tipo tostado,

 MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.navigationController.view animated:YES]; // Configure for text only and offset down hud.mode = MBProgressHUDModeText; hud.label.text = @"Some message..."; hud.margin = 10.f; hud.yOffset = 150.f; hud.removeFromSuperViewOnHide = YES; [hud hideAnimated:YES afterDelay:3]; 

Introduzca aquí la descripción de la imagen

 NSString *message = @"Some message..."; UIAlertView *toast = [[UIAlertView alloc] initWithTitle:nil message:message delegate:nil cancelButtonTitle:nil otherButtonTitles:nil, nil]; [toast show]; int duration = 1; // duration in seconds dispatch_after(dispatch_time(DISPATCH_TIME_NOW, duration * NSEC_PER_SEC), dispatch_get_main_queue(), ^{ [toast dismissWithClickedButtonIndex:0 animated:YES]; }); 

Uso de UIAlertViewController para iOS 9 o posterior

 NSString *message = @"Some message..."; UIAlertController *alert = [UIAlertController alertControllerWithTitle:nil message:message preferredStyle:UIAlertControllerStyleAlert]; [self presentViewController:alert animated:YES completion:nil]; int duration = 1; // duration in seconds dispatch_after(dispatch_time(DISPATCH_TIME_NOW, duration * NSEC_PER_SEC), dispatch_get_main_queue(), ^{ [alert dismissViewControllerAnimated:YES completion:nil]; }); 

En Android, un Toast es un mensaje corto que se muestra en la pantalla durante un corto período de tiempo y luego desaparece automáticamente sin interrumpir la interacción del usuario con la aplicación.

Introduzca aquí la descripción de la imagen

Así que muchas personas que vienen de un fondo de Android quieren saber lo que es la versión iOS de un brindis. Además de la pregunta actual, otras preguntas similares se pueden encontrar aquí , aquí y aquí . La respuesta es que no hay un equivalente exacto a un brindis en iOS . Varias soluciones que se han presentado, sin embargo, incluyendo

  • Haciendo tu propia tostada con un UIView (ver aquí , aquí , aquí , y aquí )
  • La importación de un proyecto de terceros que imita un brindis (véase aquí , aquí , aquí y aquí )
  • Utilizando una alarma sin botones con un temporizador (vea aquí )

Sin embargo, mi consejo es seguir con las opciones de interfaz de usuario estándar que ya vienen con iOS. No intentes hacer que tu aplicación se vea y se comporte exactamente igual que la versión de Android. Piense en cómo volver a empaquetarlo para que se vea y se sienta como una aplicación de iOS. Consulte el siguiente enlace para ver algunas opciones.

  • Descripción general de las opciones estándar de iOS para mostrar temporalmente información a un usuario.

Considere rediseñar la interfaz de usuario de una manera que transmita la misma información. O, si la información es muy importante, entonces una alerta podría ser la respuesta.

Para los que usan Xamarin.IOS puedes hacer esto:

 new UIAlertView(null, message, null, "OK", null).Show(); 

Utilizando UIKit; es requerido.

Si quieres uno con iOS Style, descarga este framework desde Github

IOS Toast Alert View Framework

Estos ejemplos trabajan en UIViewController, una vez que importó el Marco.

Ejemplo 1:

 //Manual let tav = ToastAlertView() tav.message = "Hey!" tav.image = UIImage(named: "img1")! tav.show() //tav.dismiss() to Hide 

Ejemplo 2

 //Toast Alert View with Time Dissmis Only self.showToastAlert("5 Seconds", image: UIImage(named: "img1")!, hideWithTap: false, hideWithTime: true, hideTime: 5.0) 

Final:

Toast Alert Ver ejemplo de imagen

Swift 2.0:

Haga un nuevo archivo rápido. (File-New-File-Empty Swift File). Nombre UIViewToast.Add el siguiente código.

 // UIViewToast.swift import UIKit func /(lhs: CGFloat, rhs: Int) -> CGFloat { return lhs / CGFloat(rhs) } let HRToastDefaultDuration = 2.0 let HRToastFadeDuration = 0.2 let HRToastHorizontalMargin : CGFloat = 10.0 let HRToastVerticalMargin : CGFloat = 10.0 let HRToastPositionDefault = "bottom" let HRToastPositionTop = "top" let HRToastPositionCenter = "center" // activity let HRToastActivityWidth : CGFloat = 100.0 let HRToastActivityHeight : CGFloat = 100.0 let HRToastActivityPositionDefault = "center" // image size let HRToastImageViewWidth : CGFloat = 80.0 let HRToastImageViewHeight: CGFloat = 80.0 // label setting let HRToastMaxWidth : CGFloat = 0.8; // 80% of parent view width let HRToastMaxHeight : CGFloat = 0.8; let HRToastFontSize : CGFloat = 16.0 let HRToastMaxTitleLines = 0 let HRToastMaxMessageLines = 0 // shadow appearance let HRToastShadowOpacity : CGFloat = 0.8 let HRToastShadowRadius : CGFloat = 6.0 let HRToastShadowOffset : CGSize = CGSizeMake(CGFloat(4.0), CGFloat(4.0)) let HRToastOpacity : CGFloat = 0.5 let HRToastCornerRadius : CGFloat = 10.0 var HRToastActivityView: UnsafePointer<UIView> = nil var HRToastTimer: UnsafePointer<NSTimer> = nil var HRToastView: UnsafePointer<UIView> = nil // Color Scheme let HRAppColor:UIColor = UIappViewController().appUIColor let HRAppColor_2:UIColor = UIColor.whiteColor() let HRToastHidesOnTap = true let HRToastDisplayShadow = false //HRToast (UIView + Toast using Swift) extension UIView { //public methods func makeToast(message msg: String) { self.makeToast(message: msg, duration: HRToastDefaultDuration, position: HRToastPositionDefault) } func makeToast(message msg: String, duration: Double, position: AnyObject) { let toast = self.viewForMessage(msg, title: nil, image: nil) self.showToast(toast: toast!, duration: duration, position: position) } func makeToast(message msg: String, duration: Double, position: AnyObject, title: String) { let toast = self.viewForMessage(msg, title: title, image: nil) self.showToast(toast: toast!, duration: duration, position: position) } func makeToast(message msg: String, duration: Double, position: AnyObject, image: UIImage) { let toast = self.viewForMessage(msg, title: nil, image: image) self.showToast(toast: toast!, duration: duration, position: position) } func makeToast(message msg: String, duration: Double, position: AnyObject, title: String, image: UIImage) { let toast = self.viewForMessage(msg, title: title, image: image) self.showToast(toast: toast!, duration: duration, position: position) } func showToast(toast toast: UIView) { self.showToast(toast: toast, duration: HRToastDefaultDuration, position: HRToastPositionDefault) } func showToast(toast toast: UIView, duration: Double, position: AnyObject) { let existToast = objc_getAssociatedObject(self, &HRToastView) as! UIView? if existToast != nil { if let timer: NSTimer = objc_getAssociatedObject(existToast, &HRToastTimer) as? NSTimer { timer.invalidate(); } self.hideToast(toast: existToast!, force: false); } toast.center = self.centerPointForPosition(position, toast: toast) toast.alpha = 0.0 if HRToastHidesOnTap { let tapRecognizer = UITapGestureRecognizer(target: toast, action: Selector("handleToastTapped:")) toast.addGestureRecognizer(tapRecognizer) toast.userInteractionEnabled = true; toast.exclusiveTouch = true; } self.addSubview(toast) objc_setAssociatedObject(self, &HRToastView, toast, objc_AssociationPolicy.OBJC_ASSOCIATION_RETAIN) UIView.animateWithDuration(HRToastFadeDuration, delay: 0.0, options: ([.CurveEaseOut, .AllowUserInteraction]), animations: { toast.alpha = 1.0 }, completion: { (finished: Bool) in let timer = NSTimer.scheduledTimerWithTimeInterval(duration, target: self, selector: Selector("toastTimerDidFinish:"), userInfo: toast, repeats: false) objc_setAssociatedObject(toast, &HRToastTimer, timer, objc_AssociationPolicy.OBJC_ASSOCIATION_RETAIN_NONATOMIC) }) } func makeToastActivity() { self.makeToastActivity(position: HRToastActivityPositionDefault) } func showToastActivity() { self.userInteractionEnabled = false self.makeToastActivity() } func removeToastActivity() { self.userInteractionEnabled = true self.hideToastActivity() } func makeToastActivityWithMessage(message msg: String){ self.makeToastActivity(position: HRToastActivityPositionDefault, message: msg) } func makeToastActivityWithMessage(message msg: String,addOverlay: Bool){ self.makeToastActivity(position: HRToastActivityPositionDefault, message: msg,addOverlay: true) } func makeToastActivity(position pos: AnyObject, message msg: String = "",addOverlay overlay: Bool = false) { let existingActivityView: UIView? = objc_getAssociatedObject(self, &HRToastActivityView) as? UIView if existingActivityView != nil { return } let activityView = UIView(frame: CGRectMake(0, 0, self.frame.width, self.frame.height)) activityView.center = self.centerPointForPosition(pos, toast: activityView) activityView.alpha = 0.0 activityView.autoresizingMask = ([.FlexibleLeftMargin, .FlexibleTopMargin, .FlexibleRightMargin, .FlexibleBottomMargin]) activityView.layer.cornerRadius = HRToastCornerRadius if HRToastDisplayShadow { activityView.layer.shadowColor = UIColor.blackColor().CGColor activityView.layer.shadowOpacity = Float(HRToastShadowOpacity) activityView.layer.shadowRadius = HRToastShadowRadius activityView.layer.shadowOffset = HRToastShadowOffset } let activityIndicatorView = UIActivityIndicatorView(activityIndicatorStyle: .WhiteLarge) activityIndicatorView.center = CGPointMake(activityView.bounds.size.width / 2, activityView.bounds.size.height / 2) activityIndicatorView.color = HRAppColor activityView.addSubview(activityIndicatorView) activityIndicatorView.startAnimating() if (!msg.isEmpty){ activityIndicatorView.frame.origin.y -= 10 let activityMessageLabel = UILabel(frame: CGRectMake(activityView.bounds.origin.x, (activityIndicatorView.frame.origin.y + activityIndicatorView.frame.size.height + 10), activityView.bounds.size.width, 20)) activityMessageLabel.textColor = UIColor.whiteColor() activityMessageLabel.font = (msg.characters.count<=10) ? UIFont(name:activityMessageLabel.font.fontName, size: 16) : UIFont(name:activityMessageLabel.font.fontName, size: 16) activityMessageLabel.textAlignment = .Center activityMessageLabel.text = msg + ".." if overlay { activityMessageLabel.textColor = UIColor.whiteColor() activityView.backgroundColor = HRAppColor.colorWithAlphaComponent(HRToastOpacity) activityIndicatorView.color = UIColor.whiteColor() } else { activityMessageLabel.textColor = HRAppColor activityView.backgroundColor = UIColor.clearColor() activityIndicatorView.color = HRAppColor } activityView.addSubview(activityMessageLabel) } self.addSubview(activityView) // associate activity view with self objc_setAssociatedObject(self, &HRToastActivityView, activityView, objc_AssociationPolicy.OBJC_ASSOCIATION_RETAIN_NONATOMIC) UIView.animateWithDuration(HRToastFadeDuration, delay: 0.0, options: UIViewAnimationOptions.CurveEaseOut, animations: { activityView.alpha = 1.0 }, completion: nil) self.userInteractionEnabled = false } func hideToastActivity() { self.userInteractionEnabled = true let existingActivityView = objc_getAssociatedObject(self, &HRToastActivityView) as! UIView? if existingActivityView == nil { return } UIView.animateWithDuration(HRToastFadeDuration, delay: 0.0, options: UIViewAnimationOptions.CurveEaseOut, animations: { existingActivityView!.alpha = 0.0 }, completion: { (finished: Bool) in existingActivityView!.removeFromSuperview() objc_setAssociatedObject(self, &HRToastActivityView, nil, objc_AssociationPolicy.OBJC_ASSOCIATION_RETAIN_NONATOMIC) }) } /* * private methods (helper) */ func hideToast(toast toast: UIView) { self.userInteractionEnabled = true self.hideToast(toast: toast, force: false); } func hideToast(toast toast: UIView, force: Bool) { let completeClosure = { (finish: Bool) -> () in toast.removeFromSuperview() objc_setAssociatedObject(self, &HRToastTimer, nil, objc_AssociationPolicy.OBJC_ASSOCIATION_RETAIN_NONATOMIC) } if force { completeClosure(true) } else { UIView.animateWithDuration(HRToastFadeDuration, delay: 0.0, options: ([.CurveEaseIn, .BeginFromCurrentState]), animations: { toast.alpha = 0.0 }, completion:completeClosure) } } func toastTimerDidFinish(timer: NSTimer) { self.hideToast(toast: timer.userInfo as! UIView) } func handleToastTapped(recognizer: UITapGestureRecognizer) { // var timer = objc_getAssociatedObject(self, &HRToastTimer) as! NSTimer // timer.invalidate() self.hideToast(toast: recognizer.view!) } func centerPointForPosition(position: AnyObject, toast: UIView) -> CGPoint { if position is String { let toastSize = toast.bounds.size let viewSize = self.bounds.size if position.lowercaseString == HRToastPositionTop { return CGPointMake(viewSize.width/2, toastSize.height/2 + HRToastVerticalMargin) } else if position.lowercaseString == HRToastPositionDefault { return CGPointMake(viewSize.width/2, viewSize.height - toastSize.height - 15 - HRToastVerticalMargin) } else if position.lowercaseString == HRToastPositionCenter { return CGPointMake(viewSize.width/2, viewSize.height/2) } } else if position is NSValue { return position.CGPointValue } print("Warning: Invalid position for toast.") return self.centerPointForPosition(HRToastPositionDefault, toast: toast) } func viewForMessage(msg: String?, title: String?, image: UIImage?) -> UIView? { if msg == nil && title == nil && image == nil { return nil } var msgLabel: UILabel? var titleLabel: UILabel? var imageView: UIImageView? let wrapperView = UIView() wrapperView.autoresizingMask = ([.FlexibleLeftMargin, .FlexibleRightMargin, .FlexibleTopMargin, .FlexibleBottomMargin]) wrapperView.layer.cornerRadius = HRToastCornerRadius wrapperView.backgroundColor = UIColor.blackColor().colorWithAlphaComponent(HRToastOpacity) if HRToastDisplayShadow { wrapperView.layer.shadowColor = UIColor.blackColor().CGColor wrapperView.layer.shadowOpacity = Float(HRToastShadowOpacity) wrapperView.layer.shadowRadius = HRToastShadowRadius wrapperView.layer.shadowOffset = HRToastShadowOffset } if image != nil { imageView = UIImageView(image: image) imageView!.contentMode = .ScaleAspectFit imageView!.frame = CGRectMake(HRToastHorizontalMargin, HRToastVerticalMargin, CGFloat(HRToastImageViewWidth), CGFloat(HRToastImageViewHeight)) } var imageWidth: CGFloat, imageHeight: CGFloat, imageLeft: CGFloat if imageView != nil { imageWidth = imageView!.bounds.size.width imageHeight = imageView!.bounds.size.height imageLeft = HRToastHorizontalMargin } else { imageWidth = 0.0; imageHeight = 0.0; imageLeft = 0.0 } if title != nil { titleLabel = UILabel() titleLabel!.numberOfLines = HRToastMaxTitleLines titleLabel!.font = UIFont.boldSystemFontOfSize(HRToastFontSize) titleLabel!.textAlignment = .Center titleLabel!.lineBreakMode = .ByWordWrapping titleLabel!.textColor = UIColor.whiteColor() titleLabel!.backgroundColor = UIColor.clearColor() titleLabel!.alpha = 1.0 titleLabel!.text = title // size the title label according to the length of the text let maxSizeTitle = CGSizeMake((self.bounds.size.width * HRToastMaxWidth) - imageWidth, self.bounds.size.height * HRToastMaxHeight); let expectedHeight = title!.stringHeightWithFontSize(HRToastFontSize, width: maxSizeTitle.width) titleLabel!.frame = CGRectMake(0.0, 0.0, maxSizeTitle.width, expectedHeight) } if msg != nil { msgLabel = UILabel(); msgLabel!.numberOfLines = HRToastMaxMessageLines msgLabel!.font = UIFont.systemFontOfSize(HRToastFontSize) msgLabel!.lineBreakMode = .ByWordWrapping msgLabel!.textAlignment = .Center msgLabel!.textColor = UIColor.whiteColor() msgLabel!.backgroundColor = UIColor.clearColor() msgLabel!.alpha = 1.0 msgLabel!.text = msg let maxSizeMessage = CGSizeMake((self.bounds.size.width * HRToastMaxWidth) - imageWidth, self.bounds.size.height * HRToastMaxHeight) let expectedHeight = msg!.stringHeightWithFontSize(HRToastFontSize, width: maxSizeMessage.width) msgLabel!.frame = CGRectMake(0.0, 0.0, maxSizeMessage.width, expectedHeight) } var titleWidth: CGFloat, titleHeight: CGFloat, titleTop: CGFloat, titleLeft: CGFloat if titleLabel != nil { titleWidth = titleLabel!.bounds.size.width titleHeight = titleLabel!.bounds.size.height titleTop = HRToastVerticalMargin titleLeft = imageLeft + imageWidth + HRToastHorizontalMargin } else { titleWidth = 0.0; titleHeight = 0.0; titleTop = 0.0; titleLeft = 0.0 } var msgWidth: CGFloat, msgHeight: CGFloat, msgTop: CGFloat, msgLeft: CGFloat if msgLabel != nil { msgWidth = msgLabel!.bounds.size.width msgHeight = msgLabel!.bounds.size.height msgTop = titleTop + titleHeight + HRToastVerticalMargin msgLeft = imageLeft + imageWidth + HRToastHorizontalMargin } else { msgWidth = 0.0; msgHeight = 0.0; msgTop = 0.0; msgLeft = 0.0 } let largerWidth = max(titleWidth, msgWidth) let largerLeft = max(titleLeft, msgLeft) // set wrapper view's frame let wrapperWidth = max(imageWidth + HRToastHorizontalMargin * 2, largerLeft + largerWidth + HRToastHorizontalMargin) let wrapperHeight = max(msgTop + msgHeight + HRToastVerticalMargin, imageHeight + HRToastVerticalMargin * 2) wrapperView.frame = CGRectMake(0.0, 0.0, wrapperWidth, wrapperHeight) // add subviews if titleLabel != nil { titleLabel!.frame = CGRectMake(titleLeft, titleTop, titleWidth, titleHeight) wrapperView.addSubview(titleLabel!) } if msgLabel != nil { msgLabel!.frame = CGRectMake(msgLeft, msgTop, msgWidth, msgHeight) wrapperView.addSubview(msgLabel!) } if imageView != nil { wrapperView.addSubview(imageView!) } return wrapperView } } extension String { func stringHeightWithFontSize(fontSize: CGFloat,width: CGFloat) -> CGFloat { let font = UIFont.systemFontOfSize(fontSize) let size = CGSizeMake(width, CGFloat.max) let paragraphStyle = NSMutableParagraphStyle() paragraphStyle.lineBreakMode = .ByWordWrapping; let attributes = [NSFontAttributeName:font, NSParagraphStyleAttributeName:paragraphStyle.copy()] let text = self as NSString let rect = text.boundingRectWithSize(size, options:.UsesLineFragmentOrigin, attributes: attributes, context:nil) return rect.size.height } } 

Uso:

  self.view.makeToast(message: "Simple Toast") self.view.makeToast(message: "Simple Toast", duration: 2.0, position:HRToastPositionTop) self.view.makeToast(message: "Simple Toast", duration: 2.0, position: HRToastPositionCenter, image: UIImage(named: "ic_120x120")!) self.view.makeToast(message: "It is just awesome", duration: 2.0, position: HRToastPositionDefault, title: "Simple Toast") self.view.makeToast(message: "It is just awesome", duration: 2.0, position: HRToastPositionCenter, title: "Simple Toast", image: UIImage(named: "ic_120x120")!) self.view.makeToastActivity() self.view.makeToastActivity(position: HRToastPositionCenter) self.view.makeToastActivity(position: HRToastPositionDefault, message: "Loading") self.view.makeToastActivityWithMessage(message: "Loading") // Hide Toast self.view.hideToast(toast: self.view) self.view.hideToast(toast: self.view, force: true) self.view.hideToastActivity() 

Rápida implementación de Android Toast utilizando Alert que se disipa después de 3 seg.

  func showAlertView(title: String?, message: String?) { let alertController = UIAlertController(title: title, message: message, preferredStyle: .Alert) let okAction = UIAlertAction(title: "OK", style: .Cancel, handler: nil) alertController.addAction(okAction) self.presentViewController(alertController, animated: true, completion: nil) let delayTime = dispatch_time(DISPATCH_TIME_NOW, Int64(3 * Double(NSEC_PER_SEC))) dispatch_after(delayTime, dispatch_get_main_queue()) { print("Bye. Lovvy") alertController.dismissViewControllerAnimated(true, completion: nil) } } 

Para llamarlo simplemente:

 self.showAlertView("Message sent...", message: nil) 

Una vez más si se utiliza IOS en Xamarin hay un nuevo componente llamado BTProgressHUD en el almacén de componentes

1) Descargar toast-notifications-ios desde este enlace

2) vaya a Targets -> Build Phases y agregue -fno-objc-arc a las "fuentes del compilador" para los archivos relevantes

3) hacer una función y #import "iToast.h"

 -(void)showToast :(NSString *)strMessage { iToast * objiTost = [iToast makeText:strMessage]; [objiTost setFontSize:11]; [objiTost setDuration:iToastDurationNormal]; [objiTost setGravity:iToastGravityBottom]; [objiTost show]; } 

4) llamada donde necesita mostrar el mensaje de brindis

 [self showToast:@"This is example text."]; 

Para Swift 2.0 y considerando https://stackoverflow.com/a/5079536/6144027

  //TOAST let alertController = UIAlertController(title: "", message: "This is a Toast.LENGTH_SHORT", preferredStyle: .Alert) self!.presentViewController(alertController, animated: true, completion: nil) let delayTime = dispatch_time(DISPATCH_TIME_NOW, Int64(2.0 * Double(NSEC_PER_SEC))) dispatch_after(delayTime, dispatch_get_main_queue()) { alertController.dismissViewControllerAnimated(true, completion: nil) } 

Pensé en una manera sencilla de hacer el brindis! Usando UIAlertController sin botón! ¡Utilizamos el texto del botón como nuestro mensaje! ¿Consíguelo? Ver abajo código:

 func alert(title: String?, message: String?, bdy:String) { let alertController = UIAlertController(title: title, message: message, preferredStyle: .Alert) let okAction = UIAlertAction(title: bdy, style: .Cancel, handler: nil) alertController.addAction(okAction) self.presentViewController(alertController, animated: true, completion: nil) let delayTime = dispatch_time(DISPATCH_TIME_NOW, Int64(2 * Double(NSEC_PER_SEC))) dispatch_after(delayTime, dispatch_get_main_queue()) { //print("Bye. Lovvy") alertController.dismissViewControllerAnimated(true, completion: nil) } } 

Úsalo así:

 self.alert(nil,message:nil,bdy:"Simple Toast!") // toast self.alert(nil,message:nil,bdy:"Alert") // alert with "Alert" button 

Aquí está su solución:
Puesto debajo del código en su proyecto de Xcode y gozar,

 - (void)showMessage:(NSString*)message atPoint:(CGPoint)point { const CGFloat fontSize = 16; UILabel* label = [[UILabel alloc] initWithFrame:CGRectZero]; label.backgroundColor = [UIColor clearColor]; label.font = [UIFont fontWithName:@"Helvetica-Bold" size:fontSize]; label.text = message; label.textColor = UIColorFromRGB(0x07575B); [label sizeToFit]; label.center = point; [self.view addSubview:label]; [UIView animateWithDuration:0.3 delay:1 options:0 animations:^{ label.alpha = 0; } completion:^(BOOL finished) { label.hidden = YES; [label removeFromSuperview]; }]; } 

Cómo utilizar ?

 [self showMessage:@"Toast in iOS" atPoint:CGPointMake(160, 695)]; 

Para mí esta solución funciona bien: https://github.com/cruffenach/CRToast

Introduzca aquí la descripción de la imagen

Ejemplo de uso:

  NSDictionary *options = @{ kCRToastTextKey : @"Hello World!", kCRToastTextAlignmentKey : @(NSTextAlignmentCenter), kCRToastBackgroundColorKey : [UIColor redColor], kCRToastAnimationInTypeKey : @(CRToastAnimationTypeGravity), kCRToastAnimationOutTypeKey : @(CRToastAnimationTypeGravity), kCRToastAnimationInDirectionKey : @(CRToastAnimationDirectionLeft), kCRToastAnimationOutDirectionKey : @(CRToastAnimationDirectionRight) }; [CRToastManager showNotificationWithOptions:options completionBlock:^{ NSLog(@"Completed"); }]; 
FlipAndroid es un fan de Google para Android, Todo sobre Android Phones, Android Wear, Android Dev y Aplicaciones para Android Aplicaciones.