Skip to content

Commit

Permalink
1.7.1
Browse files Browse the repository at this point in the history
  • Loading branch information
nathantannar4 committed Dec 12, 2024
1 parent 6e9a482 commit 614e7d1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ let package = Package(
),
],
dependencies: [
.package(url: "https://github.com/nathantannar4/Engine", from: "1.9.0"),
.package(url: "https://github.com/nathantannar4/Turbocharger", from: "1.3.1"),
.package(url: "https://github.com/nathantannar4/Engine", from: "1.9.3"),
.package(url: "https://github.com/nathantannar4/Turbocharger", from: "1.3.3"),
],
targets: [
.target(
Expand Down
6 changes: 6 additions & 0 deletions Sources/Transmission/Sources/PresentationLinkModifier.swift
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,12 @@ private struct PresentationLinkModifierBody<
adapter.viewController.presentationDelegate = context.coordinator
}

var presentingViewController = presentingViewController
if !transition.value.options.shouldAutomaticallyDismissPresentedView {
while let presenting = presentingViewController.presentedViewController {
presentingViewController = presenting
}
}
let present: () -> Void = {
guard let viewController = adapter.viewController else { return }
presentingViewController.present(
Expand Down
4 changes: 4 additions & 0 deletions Sources/Transmission/Sources/PresentationLinkTransition.swift
Original file line number Diff line number Diff line change
Expand Up @@ -115,19 +115,23 @@ extension PresentationLinkTransition {
public var isDestinationReusable: Bool
/// When `true`, the destination will be dismissed when the presentation source is dismantled
public var shouldAutomaticallyDismissDestination: Bool
/// When `true`, the destination will be presented after dismissing the view the presentation source is already presenting.
public var shouldAutomaticallyDismissPresentedView: Bool
public var modalPresentationCapturesStatusBarAppearance: Bool
public var preferredPresentationBackgroundColor: Color?

public init(
isInteractive: Bool = true,
isDestinationReusable: Bool = false,
shouldAutomaticallyDismissDestination: Bool = true,
shouldAutomaticallyDismissPresentedView: Bool = true,
modalPresentationCapturesStatusBarAppearance: Bool = false,
preferredPresentationBackgroundColor: Color? = nil
) {
self.isInteractive = isInteractive
self.isDestinationReusable = isDestinationReusable
self.shouldAutomaticallyDismissDestination = shouldAutomaticallyDismissDestination
self.shouldAutomaticallyDismissPresentedView = shouldAutomaticallyDismissPresentedView
self.modalPresentationCapturesStatusBarAppearance = modalPresentationCapturesStatusBarAppearance
self.preferredPresentationBackgroundColor = preferredPresentationBackgroundColor
}
Expand Down

0 comments on commit 614e7d1

Please sign in to comment.