- Welcome
- Getting started
- Latest updates
- Foundations
-
Components
- Accordion
- Alert
- Alignment
- App Search Modal
- Aria live
- Autosuggest
- Badge
- Banner alert
- Bar chart
- Blockquote
- Bottom navigation
- Bottom sheet
- Breadcrumb
- Breakpoint
- Button
- Calendar
- Card
- Card list
- Card button
- Carousel
- Checkbox
- Chip
- Chip group
- Code
- Content cards
- Data Table
- Datepicker
- Description list
- Dialog
- Divider
- Drawer
- Field Set
- Flare
- Flat list
- Flight leg
- Floating action button
- Floating notification
- Form label
- Form validation
- Graphic promotion
- Horizontal navigation
- Icon
- Image
- Image Gallery
- Infinite scroll
- Info Banner
- Inset Banner
- Link
- List
- Map
- Mobile scroll container
- Modal
- Navigation bar
- Navigation Tab Group
- Nudger
- Overlay
- Page indicator
- Pagination
- Panel
- Phone input
- Picker
- Popover
- Price
- Progress bar
- Radio button
- Rating
- Rating Bar
- Scrollable calendar
- Search Modal
- Section header
- Section list
- Select
- Skeleton
- Skip link
- Slider
- Snackbar
- Snippet
- Spinner
- Split input
- Star rating
- Swap Button
- Switch
- Table
- Text
- Text input
- Theming
- Ticket
- Toast
- Tooltip
- Touchable native feedback
- Touchable overlay
- Search Input Summary
- Content
- Accessibility
- Contributing
- Localisation
Toast
Toasts provide brief messages about app processes at the bottom of the screen.
Backpack/Toast
Default
Day | Night |
---|---|
Installation
In Podfile add
pod 'Backpack'
and then run pod install.
Usage
Backpack/Toast contains a Backpack Toast component in the class BPKToast.It can display a toast view with a title and details text, it also contains a spinner view.
Swift
import Backpack
let toast = BPKToast.showAdded(to: self.view, animated: true, accessibilityAnnouncement: "Announcement for VoiceOver")
toast.mode = .indeterminate // This is the default
toast.labelText = "This is the title"
toast.detailsLabelText = "Details label text"
toast.hide(true, afterDelay: 1.5)
Objective-C
#import <Backpack/Toast.h>
BPKToast *toast = [BPKToast showToastAddedTo:self.view animated:YES accessibilityAnnouncement:@"Announcement for VoiceOver"];
toast.mode = BPKToastModeIndeterminate; // This is the default;
toast.removeFromSuperViewOnHide = YES;
toast.labelText = @"Title text"
toast.detailsLabelText = @"Details text"
[toast hide:YES afterDelay:1.5];
Accessibility
Make sure you provide a translated string for the accessibilityAnnouncement property. This will be used to trigger a VoiceOver announcement whenever the Toast is presented.
Made with ❤️ by Skyscanner © 2024
© 2024 Skyscanner Backpack. Page last updated on Oct 31, 2022, 13:37