All notable changes to this project will be documented in this file.
- Fix #191 Prevent usage of UIApplication.shared when building for extensions
- #192 Add a way to test compilation with app extension
- #183 Added iOS app extension support at compile time.
- Fix #185 Incorrect margin adjustments in landscape
- Fix #188 Physics animation visual glitch
- Updates for Swift 4.1
- #164 Added an optional
windowViewController
property toSwiftMessages.Config
for supplying a custom subclass ofWindowViewController
.
- Custom presentation styles using
TopBottomAnimation
now display properly under top and bottom bars.
- #152 Get current message being displayed without specifying an
id
- Fix #134 add support for
CenterAnimation
displayed on top or bottom instead of center (renamed toPhysicsAnimation
).
- Fix #128 move icons out of asset catalog to prevent mysterious crash
- Fix #129 adjust layout margins on orientation change to preserve layout when iOS hides status bar in landscape.
- Fix #131 by always completing hide/show animations if application isn't active.
-
Swift 4.0 syntax
-
Added support for iOS 11 and iPhone X. From the readme:
SwiftMessages 4 supports iOS 11 out-of-the-box with built-in support for safe areas. To ensur that message view layouts look just right when overlapping safe areas, views that adopt the
MarginAdjustable
protocol (likeMessageView
) will have their layout margins automatically adjusted by SwiftMessages. However, there is no one-size-fits-all adjustment, so the following properties were added toMarginAdjustable
to allow for additional adjustments to be made to the layout margins:public protocol MarginAdjustable { ... /// Safe area top adjustment in iOS 11+ var safeAreaTopOffset: CGFloat { get set } /// Safe area bottom adjustment in iOS 11+ var safeAreaBottomOffset: CGFloat { get set } }
If you're using using custom nib files or view classes and your layouts don't look quite right, try adjusting the values of these properties.
BaseView
(the super class ofMessageView
) declares these properties to be@IBDesignable
and you can find sample values in the nib files included with SwiftMessages.
- Fix #100 memory leak.
- Change
Layout
enum capitalization to current Swift conventions.
- Undo change that broke
MessageView
class reference on nib files copied out of the SwiftMessages framework.
-
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") { ... }
- Fix #116 for message views that don't adopt the
Identifiable
protocol by using the memory address as the ID. - Fix #113 MessageView not hiding
- Fix #87 Support manual install
- 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).PhysicsPanHandler
class to provide a physics-based dismissal gesture. - Added
.centered
message view layout with elements centered and arranged vertically. - Added
configureBackgroundView(width:)
andconfigureBackgroundView(sideMargin:)
convenience methods toMessageView
.
- #89 Add
blur
dim mode option.
- #98 Fix touch handling in message view's background view.
- #97 Fix main thread checker warning
- Fix an issue where rapidly showing and hiding messages could result in messages becoming orphaned on-screen.
-
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
.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.
- Fix regression where the UI was being blocked when using
DimMode.none
.
- Add proper support for VoiceOver. See the Accessibility section of the readme.
- Fix infinite loop bug introduced in 3.2.0.
- 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.
- 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
- Fix memory leak of
MessageViews
.
- Fixed an issue where UIKit components were being instantiated off the main queue.
- Added the ability to set a custom value on
MessageView.id
. This can be useful for dismissing specific messages using a pre-definedid
.
- Changed the default behavior when a message is displayed in its own window (such as with
.window
presentation context) to no longer become the key window in order to prevent the keyboard from dismissing. If one needs the message's window to become key, this can be done by settingSwiftMessages.Config.becomeKeyWindow
totrue
. See
- Changed the internal logic of hiding a message view to always succeed to work around the problem of the hide animation failing, such as when started while the app is not active.
- Improved reliability of the automatic adjustments made to avoid message views overlapping the status bar, particularly when using the
.view
presentation context.
- Added a
view
case topresentationContext
for displaying the message in a specific container view.
- Add
eventListeners
option toSwiftMessages.Config
to specify a list of event listeners to be notified of message show and hide events.
- Add
ignoreDuplicates
option toSwiftMessages.Config
to specify whether or not to ignore duplicateIdentifiable
message views.
- Add
shouldAutorotate
option toSwiftMessages.Config
for customizing device rotation behavior when messages are presented in an overlay window. By default, message will auto-rotate.
- Enable automatic provisioning on framework target
- Support for Swift 3.0.
-
Support for Swift 2.3 and Xcode 8.
The nib files needed to be updated to Xcode 8 format to work around an iOS bug. Unfortunately, this makes it necessary to break backward compatibility with Swift 2.2 and Xcode 7.
- Fix #16 Preserve status bar visibility when displaying message in a new window.
- Add default configuration
SwiftMessages.defaultConfig
that can be used when calling the variants ofshow()
that don't take aconfig
argument or as a global base for custom configs. - Add
Array.sm_random()
function that returns a random element from the array. Can be used to create a playful message that cycles randomly through a set of emoji icons, for example.
- Fix #5 Emoji not shown!
- Fix #6 There is no way to create SwiftMessages instance as there is no public initializer
- Fix Carthage-related issues.
- New layout
Layout.TabView
— likeLayout.CardView
with one end attached to the super view.
- Fix spacing between title and body text in
Layout.CardView
when body text wraps.
-
The
BaseView.contentView
property of was removed because it no longer had any functionality in the framework.This is a minor backwards incompatible change. If you've copied one of the included nib files from a previous release, you may get a key-value coding runtime error related to contentView, in which case you can subclass the view and add a
contentView
property or you can remove the outlet connection in Interface Builder.
- Remove the
iconContainer
property fromMessageView
.
- Fix constraints generated by
BaseView.installContentView()
.
- Add support for specifying an
IconStyle
in theMessageView.configureTheme()
convenience function.
- Add code comments.
- Initial release.