Skip to content

Commit

Permalink
[Popover#903] Fix swiftlint.
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-zimmermann committed Jul 2, 2024
1 parent ce11468 commit 190c43d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ final class PopoverBackgroundView: UIPopoverBackgroundView {
}
default:
self.previouslyModifiedConstraint = nil
break
}

self.arrowShape?.removeFromSuperlayer()
Expand Down Expand Up @@ -137,16 +136,15 @@ final class PopoverBackgroundView: UIPopoverBackgroundView {
let minTipY = self.cornerRadius + arrowHeight

// Bounded value between min and max tip y
let tipY = max(minTipY, min(estimatedTipY, maxTipY))
return tipY
return max(minTipY, min(estimatedTipY, maxTipY))
}

private func getLeftArrowPath() -> CGPath {
let arrowHeight = Self.arrowHeight()

let tipY = self.getTipY(arrowHeight: arrowHeight)

let tip = CGPoint(x: 0, y: tipY)
let tip = CGPoint(x: 0, y: tipY)
let topRightCorner = tip.applying(.init(translationX: arrowHeight, y: -arrowHeight))
let bottomRightCorner = tip.applying(.init(translationX: arrowHeight, y: arrowHeight))

Expand All @@ -172,8 +170,7 @@ final class PopoverBackgroundView: UIPopoverBackgroundView {
let minTipX = self.cornerRadius + arrowHeight

// Bounded value between min and max tip x
let tipX = max(minTipX, min(estimatedTipX, maxTipX))
return tipX
return max(minTipX, min(estimatedTipX, maxTipX))
}

private func getUpArrowPath() -> CGPath {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public final class PopoverViewController: UIViewController, UIPopoverPresentatio
PopoverBackgroundConfiguration.arrowSize = self.viewModel.arrowSize
self.popoverPresentationController?.popoverBackgroundViewClass = PopoverBackgroundView.self
}

/// PopoverViewController initializer
/// - Parameters:
/// - contentViewController: The viewController that will be embedded in the popover: it should have a .clear background, no padding and have a well defined preferredContentSize for the popover to calculate its size properly
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import UIKit

public extension UIViewController {

/// Presents a Spark Popover modally.
/// - Parameters:
/// - popoverViewControllerToPresent: The Spark Popover to display over the current view controller’s content
Expand Down

0 comments on commit 190c43d

Please sign in to comment.