A very flexible message bar for UIKit and SwiftUI.
SwiftMessagesSegue
custom segue subclass. Try it out in the "View Controllers" section of the Demo app. In addition to the class documentation, more can be found in the View Controllers readme.CornerRoundingView
, which provides configurable corner rounding using squircles (the smoother method of rounding corners that you see on app icons). Nib files that feature rounded corners have their backgroundView
assigned to a CornerRoundingView
. CornerRoundingView
provides a roundsLeadingCorners
option to dynamically round only the leading corners of the view when presented from top or bottom (a feature used for the tab-style layouts).MarginAdjustable
to improve configurability of layout margins.backgroundView
is inset from the message view's edges.showDuration
and hideDuration
properties to the Animator
protocol (with default implementation that returns nil
). These values enable animations to work for view controller presentation.TopBottomAnimation.closePercentThreshold
CenterAnimation
displayed on top or bottom instead of center (renamed to PhysicsAnimation
).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 (like MessageView
) will have their layout margins automatically adjusted by SwiftMessages. However, there is no one-size-fits-all adjustment, so the following properties were added to MarginAdjustable
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 of MessageView
) declares these properties to be @IBDesignable
and you can find sample values in the nib files included with SwiftMessages.
Layout
enum capitalization to current Swift conventions.