An open API service indexing awesome lists of open source software.

https://github.com/tichise/popoveralert

PopOverAlert is a PopOver style alert view.
https://github.com/tichise/popoveralert

alert cocoapods confirm coocapods menu objective-c pop popover swift

Last synced: 6 months ago
JSON representation

PopOverAlert is a PopOver style alert view.

Awesome Lists containing this project

README

          

### PopOverAlert ![CocoaPods Version](https://img.shields.io/cocoapods/v/PopOverAlert.svg?style=flat) ![Platform](https://img.shields.io/cocoapods/p/PopOverAlert.svg?style=flat) ![License](https://img.shields.io/cocoapods/l/PopOverAlert.svg?style=flat)

PopOverAlert is a PopOver style alert view.

Please use it when you want to display confirmation screen without screen transition.

### Image

#### iPhone

### Examples

#### for Swift
```
import UIKit
import PopOverAlert

class SampleViewController: UIViewController, UIAdaptivePresentationControllerDelegate {

@IBOutlet weak var baseTextView:UITextView?

override func viewDidLoad() {
super.viewDidLoad()

let barButtonItem:UIBarButtonItem = UIBarButtonItem(title: "menu", style: .plain, target: self, action: #selector(SampleViewController.openAlert(sender:)))
self.navigationItem.rightBarButtonItem = barButtonItem
}

override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
}

@objc public func openAlert(sender:UIBarButtonItem) {

let popOverAlertViewController = PopOverAlertViewController.instantiate()
popOverAlertViewController.setButtonText("OK")
popOverAlertViewController.setMessage("Do you want to send mail?")
popOverAlertViewController.setSubMessage("When you press OK, the mail will be sent immediately.")

popOverAlertViewController.setShowsVerticalScrollIndicator(true)
popOverAlertViewController.setSeparatorStyle(UITableViewCellSeparatorStyle.singleLine)
popOverAlertViewController.popoverPresentationController?.barButtonItem = sender
popOverAlertViewController.preferredContentSize = CGSize(width: 300, height:110)
popOverAlertViewController.presentationController?.delegate = self

popOverAlertViewController.setMessageFont(UIFont.systemFont(ofSize: 16))
popOverAlertViewController.setSubMessageFont(UIFont.systemFont(ofSize: 12))
popOverAlertViewController.setButtonTextFont(UIFont.systemFont(ofSize: 14))
popOverAlertViewController.setButtonTextColor(UIColor.black)

popOverAlertViewController.completionHandler = { () -> Void in

}
present(popOverAlertViewController, animated: true, completion: nil)
}

func adaptivePresentationStyle(for controller: UIPresentationController) -> UIModalPresentationStyle {
return UIModalPresentationStyle.none
}

func adaptivePresentationStyle(for controller: UIPresentationController, traitCollection: UITraitCollection) -> UIModalPresentationStyle {
return UIModalPresentationStyle.none
}
}
```

### Installation (CocoaPods)
`pod PopOverAlert`

### CocoaPods URL
- [PopOverAlert on CocoaPods.org](https://cocoapods.org/pods/PopOverAlert)

### License
PopOverAlert is available under the MIT license. See the LICENSE file for more info.