SwiftMessages

A very flexible message bar for UIKit and SwiftUI.

MIT License

Stars
7.3K
Committers
36

Bot releases are visible (Hide)

SwiftMessages - Haptics Latest Release

Published by wtmoose 9 months ago

Features

  • Add a variation on the .swiftMessage() modifier that takes a view builder instead of requiring that the bound value conform to MessageViewConvertible. This syntax is more similar to the familiar sheet() modifier syntax and provides more flexibility for constructing message views.
  • #207 Add optional haptic feedback

Changes

  • Use @MainActor to ensure that SwiftMessages is not called from a background queue.
  • Bump minimum deployment target to iOS 13.

Fixes

  • #535 window being accessed from background thread when dequeueNext is called
  • #534 Xcode warnings in two swift files
  • #533 How do I show a message that appears above the keyboard, when the keyboard is already visible?
SwiftMessages -

Published by wtmoose 9 months ago

Features

  • Add a variation on the .swiftMessage() modifier that takes a view builder instead of requiring that the bound value conform to MessageViewConvertible. This syntax is more similar to the familiar sheet() modifier syntax and provides more flexibility for constructing message views.

Changes

  • Use @MainActor to ensure that SwiftMessages is not called from a background queue.
  • Bump minimum deployment target to iOS 13.

Fixes

  • #535 window being accessed from background thread when dequeueNext is called
  • #534 Xcode warnings in two swift files
  • #533 How do I show a message that appears above the keyboard, when the keyboard is already visible?
SwiftMessages - SwiftUI sheet-like modifier

Published by wtmoose 9 months ago

9.0.10

Features

  • Add a .sheet() like variation to the .swiftMessage() modifier that takes a view builder. This provides more flexibility for constructing message views.

Fixes

  • #535 window being accessed from background thread when dequeueNext is called
  • #534 Xcode warnings in two swift files
  • #533 How do I show a message that appears above the keyboard, when the keyboard is already visible?
SwiftMessages - SwiftUI fix

Published by wtmoose 12 months ago

Fixes

  • Fix hit testing on SwiftUI views to allow touches around the view's margins to pass through to the underlying view.
  • Update KeyboardTrackingView to continue tracking the keyboard even when not installed in the view hierarchy.
SwiftMessages - 🔥🔥🔥 SwiftUI!

Published by wtmoose about 1 year ago

Changes

  • #529 Update readme and SwiftUI demo to demostrate how to mask edges.
SwiftMessages - 🔥🔥🔥 SwiftUI!

Published by wtmoose about 1 year ago

Features

  • Added support for SwiftUI

Fixes

  • #527 Crash while clicking two times to hide the presenting controller
  • #517 Prevent orphaned views from blocking the queue
  • Prevent orphaned SwiftMessagesSeques from retaining the presenting view controller
SwiftMessages -

Published by wtmoose almost 3 years ago

  • Add UIView associated type to Event, e.g. willShow(UIView) so that event listeners can inspect the view.
  • Add Event.id: String? property so that event listeners can reason about the view's ID.
SwiftMessages -

Published by wtmoose about 3 years ago

Fixes

  • #482 Fix timing of KeyboardTrackingView callbacks.
  • #483 KeyboardTrackingView causes a small space under bottom-style view
SwiftMessages - 🤬

Published by wtmoose about 3 years ago

  • #471 Xcode 13 issue - Enum cases with associated values cannot be marked potentially unavailable with '@available'
  • Improve colors for dark mode.
SwiftMessages -

Published by wtmoose over 3 years ago

Fixes

  • #467 Lower or equal level window's views disappear upon hide
  • #466 Alert not shown after Biometry check
  • #465 Fix broken Carthage build. The Carthage build was broken due to the iMessageDemo project's use of CocoaPods and the automatically generated SwiftMessages framework scheme created by CocoaPods. The podfile was modified to delete this scheme, but Carthage users may need to run pod install on the iMessagesDemo project, if they have CocoaPods installed, or manually delete the iMessageDemo/Pods/Pods.xcodeproj/xcuserdata folder.
SwiftMessages -

Published by wtmoose over 3 years ago

  • Fix app extension compile error when using CocoaPods.
SwiftMessages -

Published by wtmoose over 3 years ago

Fixes

  • #455 #458 Restore key window after message is interacted with. When a message becomes the key window, such as if the user interacts with the message, iOS does not automatically restore the previous key window when the message is dismissed. SwiftMessages has some logic in WindowViewController to restore the key window. This change makes that logic more robust.
SwiftMessages -

Published by wtmoose almost 4 years ago

Features

  • #447 Add the ability to show view controller in a new window with SwiftMessagesSegue.
    This capability is available when using SwiftMessagesSegue programmatically by supplying
    an instance of WindowViewController as the segue's source view controller.

Fixes

  • #451 Fix app extension crash

Changes

  • This release has minor breaking changes in the WindowViewController initializers.
    The windowLevel is no longer accepted as an argument because the config parameter
    should specify the window level in the presentationContext property.
SwiftMessages -

Published by wtmoose almost 4 years ago

Fixes

  • #446 Restore previous key window on dismissal if the message assumed key window status.
SwiftMessages -

Published by wtmoose almost 4 years ago

Features

  • #442 Added MarginAdjustable.respectSafeArea option to exclude safe area from layout margins.
  • #430 Support disable becomeKeyWindow from SwiftMessages.Config. This is a workaround for potential issues with apps that display additional windows.

Fixes

  • #437 Revert to explicitly specifying "SwiftMessages" as the module in nib files.
  • #440 Fix crash when using SwiftMessages in app extension
SwiftMessages - SPM Support

Published by wtmoose almost 4 years ago

Features

  • Full support for Swift Package Manager

Fixes

  • #328 ignoreDuplicates is not working
  • #412 Fix deployment target on nib files to match target
SwiftMessages - SPM Partial Support for Xcode 11

Published by wtmoose about 4 years ago

Changes

  • #395 Add preliminary support for Swift Package Manager.
SwiftMessages - Long overdue

Published by wtmoose over 4 years ago

Sorry for taking so long to release this.

Changes

  • Add SwiftMessages.PresentationContext.windowScene option for targeting a specific window scene.
  • Changed the behavior of the default presentationContext, .automatic. Previously, if the root view controller was presenting, the message would only be displayed over the presented view controller if the modalPresentationStyle was fullScreen or overFullScreen. Now, messages are always displayed over presented view controllers.
  • Made showDuraton and hideDuration on Animator non-optional.
  • Made showDuraton and hideDuration writable options on TopBottomAnimation and PhysicsAnimation.

Fixes

  • #365 Fix an issue with customized TopBottomAnimation where messages weren't properly displayed under navigation and tab bars.
  • #352 Fix accessibility for view controllers presented with SwiftMessagesSegue.
  • #355 Update card view layout to support centering of pure textual content
  • #354 Support overrideUserInterfaceStyle when view presented in its own window
  • #360 Fix touch handing issue in iOS 13.1.3
  • #382 Fix warnings in Xcode 11.4
SwiftMessages - iOS 13

Published by wtmoose about 5 years ago

Changes

  • Support iOS 13.

Features

  • #335 Add option to hide status bar when view is displayed in a window. As of iOS 13, windows can no longer cover the status bar. The only alternative is to set Config.prefersStatusBarHidden = true to hide it.
SwiftMessages - No more warnings

Published by wtmoose over 5 years ago

Changes

  • Swift 5
  • Remove deprecated APIs

Features

  • #313 Improved sizing on iPad

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.
  3. 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.

// Message view
var config = SwiftMessages.defaultConfig
config.keyboardTrackingView = KeyboardTrackingView()

// Or view controller
segue.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
Package Rankings
Top 6.04% on Carthage
Top 2.27% on Swiftpackageindex.com
Top 0.29% on Cocoapods.org
Badges
Extracted from project README
Twitter: @TimothyMoose Version License Platform Carthage compatible