Skip to content

Commit

Permalink
Release 18.14.1 (#3323)
Browse files Browse the repository at this point in the history
* Fix banner if image is taller than text

* Release 18.14.1
  • Loading branch information
rlepinski authored Dec 20, 2024
1 parent 3315848 commit 2b80009
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 24 deletions.
2 changes: 1 addition & 1 deletion Airship.podspec
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
AIRSHIP_VERSION="18.14.0"
AIRSHIP_VERSION="18.14.1"

Pod::Spec.new do |s|
s.version = AIRSHIP_VERSION
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,29 +184,29 @@ struct InAppMessageBannerView: View {
private var banner: some View {
messageBody
.frame(maxWidth: theme.maxWidth)
.background(
(displayContent.backgroundColor?.color ?? Color.white)
.cornerRadius(displayContent.borderRadius ?? 0)
.edgesIgnoringSafeArea(displayContent.placement == .top ? .top : .bottom)
.shadow(
color: theme.shadow.color,
radius: theme.shadow.radius,
x: theme.shadow.xOffset,
y: theme.shadow.yOffset
)
)
.background(
GeometryReader(content: { contentMetrics -> Color in
let size = contentMetrics.size
DispatchQueue.main.async {
if self.bannerConstraints.size != lastSize {
if self.lastSize != size {
self.bannerConstraints.size = size
self.lastSize = size
}
}
return Color.airshipTappableClear
})
)
.background(
(displayContent.backgroundColor?.color ?? Color.white)
.cornerRadius(displayContent.borderRadius ?? 0)
.edgesIgnoringSafeArea(displayContent.placement == .top ? .top : .bottom)
.shadow(
color: theme.shadow.color,
radius: theme.shadow.radius,
x: theme.shadow.xOffset,
y: theme.shadow.yOffset
)
)
.showing(isShowing: isShowing)
.padding(theme.padding)
.applyTransitioningPlacement(placement: displayContent.placement ?? .bottom)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class InAppMessageBannerViewController: InAppMessageHostingController<InAppMessa
super.viewDidAppear(animated)

createBannerConstraints()
handleBannerConstraints()
handleBannerConstraints(size: self.bannerConstraints.size)

if UIAccessibility.isVoiceOverRunning {
DispatchQueue.main.asyncAfter(deadline: .now() + InAppMessageBannerView.animationInOutDuration) {
Expand All @@ -92,7 +92,7 @@ class InAppMessageBannerViewController: InAppMessageHostingController<InAppMessa
}

subscription = bannerConstraints.$size.sink { [weak self] size in
self?.handleBannerConstraints()
self?.handleBannerConstraints(size: size)
}
}

Expand All @@ -113,22 +113,22 @@ class InAppMessageBannerViewController: InAppMessageHostingController<InAppMessa
}
}

func handleBannerConstraints() {
func handleBannerConstraints(size: CGSize) {
self.centerXConstraint?.isActive = true
self.heightConstraint?.isActive = true
self.widthConstraint?.isActive = true
self.widthConstraint?.constant = self.bannerConstraints.size.width
self.widthConstraint?.constant = size.width

switch self.placement {
case .top:
self.topConstraint?.isActive = true
self.bottomConstraint?.isActive = false
self.heightConstraint?.constant = self.bannerConstraints.size.height + self.view.safeAreaInsets.top
self.heightConstraint?.constant = size.height + self.view.safeAreaInsets.top

default:
self.topConstraint?.isActive = false
self.bottomConstraint?.isActive = true
self.heightConstraint?.constant = self.bannerConstraints.size.height + self.view.safeAreaInsets.bottom
self.heightConstraint?.constant = size.height + self.view.safeAreaInsets.bottom
}

self.view.layoutIfNeeded()
Expand Down
2 changes: 1 addition & 1 deletion Airship/AirshipConfig.xcconfig
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//* Copyright Airship and Contributors */

CURRENT_PROJECT_VERSION = 18.14.0
CURRENT_PROJECT_VERSION = 18.14.1

// Uncomment to include the preview build warning
// OTHER_CFLAGS = $(inherited) -DUA_PREVIEW=1
2 changes: 1 addition & 1 deletion Airship/AirshipCore/Source/AirshipVersion.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import Foundation

public struct AirshipVersion {
public static let version = "18.14.0"
public static let version = "18.14.1"
public static func get() -> String {
return version
}
Expand Down
2 changes: 1 addition & 1 deletion AirshipContentExtension.podspec
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
AIRSHIP_VERSION="18.14.0"
AIRSHIP_VERSION="18.14.1"

Pod::Spec.new do |s|
s.version = AIRSHIP_VERSION
Expand Down
2 changes: 1 addition & 1 deletion AirshipDebug.podspec
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
AIRSHIP_VERSION="18.14.0"
AIRSHIP_VERSION="18.14.1"

Pod::Spec.new do |s|
s.version = AIRSHIP_VERSION
Expand Down
2 changes: 1 addition & 1 deletion AirshipServiceExtension.podspec
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
AIRSHIP_VERSION="18.14.0"
AIRSHIP_VERSION="18.14.1"

Pod::Spec.new do |s|
s.version = AIRSHIP_VERSION
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@

# iOS Changelog

## Version 18.14.1 December 20, 2024
Patch release to fix Banner In-App Automations if the image is taller than the text.

### Changes
- Fix Banner In-App Automation sizing issue.

## Version 18.14.0 December 19, 2024
Minor release that fixes issues with Banner In-App Automations, reduces power usage with In-App Automations & Scenes, and updates how Feature Flags are resolved.

Expand Down

0 comments on commit 2b80009

Please sign in to comment.