Releases: SwiftKickMobile/SwiftMessages
3.5.0
Features
-
Added
SwiftMessages.hideCounted(id:)
method of hiding. The counted method hides when the number of calls toshow()
andhideCounted(id:)
for a
given message ID are equal. This can be useful for messages that may be
shown from multiple code paths to ensure that all paths are ready to hide.Also added
SwiftMessages.count(id:)
to get the current count andSwiftMessages.set(id:count:)
to set the current count. -
Added ways to retrieve message views currently being shown, hidden, or queued to be shown.
// Get a message view with the given ID if it is currently // being shown or hidden. if let view = SwiftMessages.current(id: "some id") { ... } // Get a message view with the given ID if is it currently // queued to be shown. if let view = SwiftMessages.queued(id: "some id") { ... } // Get a message view with the given ID if it is currently being // shown, hidden or in the queue to be shown. if let view = SwiftMessages.currentOrQueued(id: "some id") { ... }
Bug Fixes
Centered Messages
- Added
.center
presentation style with a physics-based dismissal gesture. - Added
.custom(animator:)
presentation style, where you provide an instance of theAnimator
protocol. TheTopBottomAnimation
andCenterAnimation
animations both implementAnimator
and may be subclassed (configuration options will be added in a future release). You may use thePhysicsPanHandler
class to incorporate a physics-based dismissal gesture into any custom animator. - Added
.centered
message view layout with elements centered and arranged vertically. - Added
configureBackgroundView(width:)
andconfigureBackgroundView(sideMargin:)
convenience methods toMessageView
.
Add .blur Dim Mode
3.3.4 Store id on init to avoid non-main queue UIKit access
3.3.3: Merge pull request #79 from rockerhx/master
Update code style: to Swift3.1
Voice Over Improvements
Improvements
-
MessageView
is smarter about including additional accessibility views for cases where you've added accessible elements to the view. Previously only thebutton
was included. Now all views whereisAccessibilityElement == true
are included.Note that all nib files now have
isAccessibilityElement == false
fortitleLabel
,bodyLabel
andiconLabel
(titleLabel
andbodyLabel
are read out as part of the overall message view's text). If any of these need to be directly accessible, then copy the nib file into your project and select "Enabled" in the Accessibility section of the Identity Inspector.
Hot Fix
Voice Over
From the README:
SwiftMessages provides excellent VoiceOver support out-of-the-box.
-
The title and body of the message are combined into a single announcement when the message is shown. The
MessageView.accessibilityPrefix
property can be set to prepend additional clarifying text to the announcement.Sometimes, a message may contain important visual cues that aren't captured in the title or body. For example, a message may rely on a yellow background to convey a warning rather than having the word "warning" in the title or body. In this case, it might be helpful to set
MessageView.accessibilityPrefix = "warning"
. -
If the message is shown with a dim view using
config.dimMode
, elements below the dim view are not focusable until the message is hidden. Ifconfig.dimMode.interactive == true
, the dim view itself will be focusable and read out "dismiss" followed by "button". The former text can be customized by setting theconfig.dimModeAccessibilityLabel
property.
See the AccessibleMessage
protocol for implementing proper accessibility support in custom views.
Hot Fix
Indefinite Duration
Features
-
Added the ability to display messages for an indefinite duration while enforcing a minimum duration using
Duration.indefinite(delay:minimum)
.This option is useful for displaying a message when a process is taking too long but you don't want to display the message if the process completes in a reasonable amount of time.
For example, if a URL load is expected to complete in 2 seconds, you may use the value
unknown(delay: 2, minimum 1)
to ensure that the message will not be displayed most of the time, but will be displayed for at least 1 second if the operation takes longer than 2 seconds. By specifying a minimum duration, you can avoid hiding the message too fast if the operation finishes right after the delay interval.
Bug Fixes
- Prevent views below the dim view from receiving accessibility focus.
- Prevent taps in the message view from hiding when using interactive dim mode.
- Fix memory leak of single message view
3.1.4: Merge pull request #57 from ceyhuno/master
Dispatched Presenter.init(config:view:delegate:) call in SwiftMessages class to the main queue