Skip to content

Commit

Permalink
Merge pull request #127 from arbridev/bordercolor
Browse files Browse the repository at this point in the history
Add border color property
  • Loading branch information
corin8823 authored Dec 31, 2019
2 parents c03b6b2 + 684a43f commit 80c065e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Classes/Popover.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public enum PopoverOption {
case springDamping(CGFloat)
case initialSpringVelocity(CGFloat)
case sideOffset(CGFloat)
case borderColor(UIColor)
}

@objc public enum PopoverType: Int {
Expand Down Expand Up @@ -54,6 +55,7 @@ open class Popover: UIView {
open var springDamping: CGFloat = 0.7
open var initialSpringVelocity: CGFloat = 3
open var sideOffset: CGFloat = 6.0
open var borderColor: UIColor?

// custom closure
open var willShowHandler: (() -> ())?
Expand Down Expand Up @@ -493,6 +495,10 @@ open class Popover: UIView {

color.setFill()
arrow.fill()
if let borderColor = borderColor {
borderColor.setStroke()
arrow.stroke()
}
}
}

Expand Down Expand Up @@ -530,6 +536,8 @@ private extension Popover {
self.initialSpringVelocity = value
case let .sideOffset(value):
self.sideOffset = value
case let .borderColor(value):
self.borderColor = value
}
}
}
Expand Down

0 comments on commit 80c065e

Please sign in to comment.