You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Snackbars](https://material.io/components/snackbars) provide brief messages about app processes at the bottom of the screen. They can contain up to two lines of text and a text action button, but no icons.
-[Snackbar Manager and Message](#snackbar-manager-and-message)
48
-
-[Suspending and Resuming Display of Messages](#suspending-and-resuming-display-of-messages)
49
-
-[Installation](#installation)
50
-
-[Installation with CocoaPods](#installation-with-cocoapods)
51
-
-[Importing](#importing)
52
-
-[Usage](#usage)
53
-
-[Typical use: display a message](#typical-use-display-a-message)
54
-
-[Typical use: display a message with an action](#typical-use-display-a-message-with-an-action)
55
-
-[Extensions](#extensions)
56
-
-[Color Theming](#color-theming)
27
+
## Using snackbars
57
28
58
-
- - -
29
+
Snackbars inform users of a process that an app has performed or will perform. They appear temporarily, towards the bottom of the screen. They shouldn’t interrupt the user experience, and they don’t require user input to disappear.
59
30
60
-
## Overview
61
-
62
-
### Snackbar Manager and Message
63
-
64
-
Snackbar is comprised of two classes: MDCSnackbarManager and MDCSnackbarMessage. Snackbar messages
65
-
contain text to be displayed to a user. Messages are passed to the manager. The manager decides when
66
-
it is appropriate to show a message to the user.
67
-
68
-
### Suspending and Resuming Display of Messages
31
+
Displaying a snackbar involves two classes: `MDCSnackbarManager` and `MDCSnackbarMessage`.
32
+
First, create an instance of `MDCSnackbarMessage` and provide a string to display to the user. Next,
33
+
pass the `MDCSnackbarMessage` to `MDCSnackbarManager.defaultManager` with the static `-showMessage:` method. This will
34
+
automatically construct an `MDCSnackbarMessageView` and appropriate overlay views so the snackbar is
35
+
visible to the user.
69
36
70
37
Snackbar manager can be instructed to suspend and resume displaying messages as needed. When
71
38
messages are suspended the manager provides a suspension token that the client must keep as long as
72
39
messages are suspended. When the client releases the suspension token or calls the manager's resume
73
40
method with the suspension token, then messages will resume being displayed.
74
-
75
-
## Installation
76
-
77
-
<!-- Extracted from docs/../../../docs/component-installation.md -->
78
-
79
-
### Installation with CocoaPods
41
+
### Installing snackbars
80
42
81
43
Add the following to your `Podfile`:
82
44
@@ -91,7 +53,7 @@ Then, run the following command:
Displaying a snackbar requires using two classes: MDCSnackbarManager and MDCSnackbarMessage.
115
-
First, create an instance of MDCSnackbarMessage and provide a string to display to the user. Next,
116
-
pass the MDCSnackbarMessage to the MDCSnackbarManager.defaultManager with the static showMessage method. This will
117
-
automatically construct an MDCSnackbarMessageView and appropriate overlay views so the snackbar is
118
-
visible to the user.
77
+
Snackbars have automatic VoiceOver support through UIKit, but `MDCSnackbarMessageView` also exposes `accessibilityLabel` and `accessibilityHint` properties for overriding the default values.
119
78
120
-
<!-- Extracted from docs/typical-use-display-a-message.md -->
79
+
#### Dynamic Type
121
80
122
-
### Typical use: display a message
81
+
`MDCSnackbarMessageView` has a `mdc_adjustsFontForContentSizeCategory` property that is modeled after Apple's `adjustsFontForContentSizeCategory` property. Set this property to `YES` for font scaling according to the current trait environment.
0 commit comments