SwiftMessages v7.0.0 Release Notes

Release Date: 2019-05-23 // almost 5 years ago
  • ๐Ÿ”„ Changes

    • Swift 5
    • โœ‚ Remove deprecated APIs

    ๐Ÿ”‹ Features

    • #313 Improved sizing on iPad

    0๏ธโƒฃ > SwiftMessagesSegue provides default view controller sizing based on device, with width on iPad being limited to 500pt max. However, it is recommended that you explicitly specify size appropriate for your content using one of the following methods.

    1. Define sufficient width and height constraints in your view controller such that it sizes itself. ๐Ÿ— > 2. Set the preferredContentSize property (a.k.a "Use Preferred Explicit Size" in Interface Builder's attribute inspector). Zeros are ignored, e.g. CGSize(width: 0, height: 350) only affects the height.
    2. Add explicit width and/or height constraints to segue.messageView.backgroundView.

    Note that Layout.topMessage and Layout.bottomMessage are always full screen width. For other layouts, the there is a maximum 500pt width on for regular horizontal size class (iPad) at 950 priority. This limit can be overridden by adding higher-priority constraints.

    • #275 Add ability to avoid the keyboard.

    The KeyboardTrackingView class can be used to cause the message view to avoid the keyboard by sliding up when the keyboard gets too close.

    0๏ธโƒฃ > // Message viewvar config = SwiftMessages.defaultConfigconfig.keyboardTrackingView = KeyboardTrackingView()// Or view controllersegue.keyboardTrackingView = KeyboardTrackingView()

    ๐Ÿ‘€ > You can incorporate KeyboardTrackingView into your app even when you're not using SwiftMessages. Install into your view hierarchy by pinning KeyboardTrackingView to the bottom, leading, and trailing edges of the screen. Then pin the bottom of your content that should avoid the keyboard to the top KeyboardTrackingView. Use an equality constraint to strictly track the keyboard or an inequality constraint to only move when the keyboard gets too close. KeyboardTrackingView works by observing keyboard notifications and adjusting its height to maintain its top edge above the keyboard, thereby pushing your content up. See the comments in KeyboardTrackingView for configuration options.

    • #276 Add ability to hide message without animation
    • #272 Add duration for SwiftMessagesSegue
    • #278 Make pan gesture recognizers public