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.
- Host: GitHub
- URL: https://github.com/tichise/popoveralert
- Owner: tichise
- License: mit
- Created: 2018-05-14T08:54:07.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-08-22T12:45:47.000Z (about 1 year ago)
- Last Synced: 2025-04-30T08:18:30.862Z (6 months ago)
- Topics: alert, cocoapods, confirm, coocapods, menu, objective-c, pop, popover, swift
- Language: Swift
- Homepage:
- Size: 50.8 KB
- Stars: 56
- Watchers: 3
- Forks: 10
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE.txt
Awesome Lists containing this project
README
### PopOverAlert   
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 PopOverAlertclass 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 = selfpopOverAlertViewController.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.