Skip to content

Commit

Permalink
Add border color property
Browse files Browse the repository at this point in the history
  • Loading branch information
arbridev committed Apr 22, 2019
1 parent 213f9cf commit 684a43f
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 @@ -468,6 +470,10 @@ open class Popover: UIView {

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

Expand Down Expand Up @@ -505,6 +511,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 684a43f

Please sign in to comment.