Skip to content

Commit

Permalink
Added popover(barButtonItem:)
Browse files Browse the repository at this point in the history
  • Loading branch information
sgr-ksmt committed May 2, 2017
1 parent bb6d5aa commit 663ba0a
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion Sources/ActionSheet.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,23 @@ extension Alertift {
/// - Parameters:
/// - view: sourceView
/// - rect: sourceRect
/// - Returns: MySelf
/// - Returns: Myself
public func popover(sourceView view: UIView?, sourceRect rect: CGRect) -> Self {
_alertController.popoverPresentationController?.sourceView = view
_alertController.popoverPresentationController?.sourceRect = rect
return self
}

/// Add barButtonItem to **popoverPresentationController**.
///
/// If you want to use action sheet on iPad, you have to use this method.
/// - Parameters:
/// - barButtonItem: UIBarButtonItem
/// - Returns: Myself
public func popover(barButtonItem: UIBarButtonItem?) -> Self {
_alertController.popoverPresentationController?.barButtonItem = barButtonItem
return self
}

deinit {
Debug.log()
Expand Down

0 comments on commit 663ba0a

Please sign in to comment.