Skip to content

Commit

Permalink
Dropped unused animated argument in attachView
Browse files Browse the repository at this point in the history
  • Loading branch information
charliescheer committed Jul 26, 2024
1 parent 04041c4 commit 25c19af
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions Simplenote/SPNavigationController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class SPNavigationController: NSViewController {
view.translatesAutoresizingMaskIntoConstraints = false
initialView.translatesAutoresizingMaskIntoConstraints = false

attachView(subview: initialViewController.view, below: nil, animated: false)
attachView(subview: initialViewController.view, below: nil)
resizeWindow(to: initialViewController.view, animated: false)

NSLayoutConstraint.activate([
Expand Down Expand Up @@ -92,7 +92,7 @@ class SPNavigationController: NSViewController {
let currentView = topViewController?.view

attach(child: viewController)
attachView(subview: viewController.view, below: currentView, animated: animated)
attachView(subview: viewController.view, below: currentView)
resizeWindow(to: viewController.view, animated: animated)

guard animated else {
Expand All @@ -111,12 +111,11 @@ class SPNavigationController: NSViewController {
viewStack.append(child)
}

private func attachView(subview: NSView, below siblingView: NSView?, animated: Bool) {
private func attachView(subview: NSView, below siblingView: NSView?) {
subview.translatesAutoresizingMaskIntoConstraints = false

if let siblingView,
animated {
heightConstraint.constant = siblingView.fittingSize.height + totalTopPadding
if let siblingView {
// heightConstraint.constant = siblingView.fittingSize.height + totalTopPadding
view.addSubview(subview, positioned: .below, relativeTo: siblingView)
} else {
view.addSubview(subview)
Expand Down Expand Up @@ -151,7 +150,7 @@ class SPNavigationController: NSViewController {
return
}

attachView(subview: nextViewController.view, below: currentViewController.view, animated: animated)
attachView(subview: nextViewController.view, below: currentViewController.view)
resizeWindow(to: nextViewController.view, animated: animated)

guard animated else {
Expand Down

0 comments on commit 25c19af

Please sign in to comment.