Permalink
Fetching contributors…
Cannot retrieve contributors at this time
27 lines (22 sloc) 565 Bytes
//
// UIBarButtonItemExtensions.swift
// SwifterSwift
//
// Created by Omar Albeik on 08/12/2016.
// Copyright © 2016 SwifterSwift
//
#if canImport(UIKit) && !os(watchOS)
import UIKit
// MARK: - Methods
public extension UIBarButtonItem {
/// SwifterSwift: Add Target to UIBarButtonItem
///
/// - Parameters:
/// - target: target.
/// - action: selector to run when button is tapped.
public func addTargetForAction(_ target: AnyObject, action: Selector) {
self.target = target
self.action = action
}
}
#endif