Skip to content

Commit

Permalink
Actually unwrap the optional value
Browse files Browse the repository at this point in the history
  • Loading branch information
Domas Nutautas committed Jul 24, 2020
1 parent a0eefa3 commit f5497b5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Sources/ImageMod/ImageModable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public extension ImageModable {
// MARK: Stack

func hStack(_ image: ImageModable?, spacing: CGFloat = 0, alignment: UIStackView.Alignment = .center) -> ImageModable {
guard let i = image else { return self }
guard let image = image else { return self }
let rect = image.canvasSize.vAlign(in: canvasSize, alignment: alignment)
return self
.padded(right: rect.maxX + spacing)
Expand All @@ -81,7 +81,7 @@ public extension ImageModable {
}

func vStack(_ image: ImageModable?, spacing: CGFloat = 0, alignment: UIStackView.Alignment = .center) -> ImageModable {
guard let i = image else { return self }
guard let image = image else { return self }
let rect = image.canvasSize.hAlign(in: canvasSize, alignment: alignment)
return self
.padded(bottom: rect.maxY + spacing)
Expand All @@ -94,7 +94,7 @@ public extension ImageModable {
}

func zStack(_ overlay: ImageModable?, alignment: UIView.ContentMode = .center) -> ImageModable {
guard let i = image else { return self }
guard let overlay = overlay else { return self }
let rect = overlay.canvasSize.align(in: canvasSize, alignment: alignment)
return with(overlay
.scaled(to: rect.size)
Expand Down

0 comments on commit f5497b5

Please sign in to comment.