1

I'm porting an Android application to iOS. Part of the user-interface is an Android Snackbar; a small box at the bottom of the screen alerting the user of something, while not being a full-fledged dialog:

SnackBar image

I tried different methods of the built-in UIAlertView from this post but there was nothing alike. Is this even possible with Swift and what are the best frameworks for Snackbar imitation?

user4157124
  • 2,809
  • 13
  • 27
  • 42
Ars_Codicis
  • 440
  • 1
  • 4
  • 16
  • 1
    Similar 3rd party lib: https://github.com/zekunyan/TTGSnackbar – RTXGamer Mar 20 '22 at 18:00
  • Does this answer your question? [snackbar with custom Function call in Swift](https://stackoverflow.com/questions/45012358/snackbar-with-custom-function-call-in-swift) – Hung Vu Mar 20 '22 at 18:04
  • 1
    It's because your question is too general and broad - which means someone probably has asked this before, and yeah, a lot have. You should ask only when there is no question on SOF that can answer you ;) – Hung Vu Mar 21 '22 at 02:02
  • You can display a notification instead of showing a snackbar. – acmpo6ou Jul 24 '23 at 17:12
  • @acmpo6ou Out of curiosity, what do you mean? A notification is "outside" of the app (handled by the OS, triggered by the app), whereas the snackbar is "inside" the app's UI. – Ars_Codicis Jul 27 '23 at 20:06
  • For SwiftUI I have created below utility. https://github.com/indrajitv/ICToastMessage – indrajit Aug 01 '23 at 05:29

1 Answers1

4

SnackBar (along with Toast, PopupDialog, etc.) is a concept baked into Android, and there's no equivalent on iOS.

You can:

  • create a custom component, and handle fly-in and fly-out animations, or,
  • use external libraries. My go-to is ahmedAlmasri's SnackBar.swift, which resembles a lot of that on Android.
Hung Vu
  • 360
  • 3
  • 11