Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
28 lines (22 sloc) 559 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.
func addTargetForAction(_ target: AnyObject, action: Selector) {
self.target = target
self.action = action
}
}
#endif
You can’t perform that action at this time.