Skip to content

Commit

Permalink
✨ Add UIBarButtonItem.init(barButtonSystemIcon:closure:)
Browse files Browse the repository at this point in the history
  • Loading branch information
takasek committed Jan 26, 2018
1 parent a839c2b commit b4da627
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ActionClosurable/Extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ extension ActionClosurable where Self: UIBarButtonItem {
self.style = style
self.onTap(closure)
}
public init(barButtonSystemItem: UIBarButtonSystemItem, closure: @escaping (Self) -> Void) {
self.init(barButtonSystemItem: barButtonSystemItem, target: nil, action: nil)
self.onTap(closure)
}
public func onTap(_ closure: @escaping (Self) -> Void) {
convert(closure: closure, toConfiguration: {
self.target = $0
Expand Down

0 comments on commit b4da627

Please sign in to comment.