Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/leavesster/ylfpopoverbackgroundview
support custom PopoverBackgroundView for UIPopoverPresentationController
https://github.com/leavesster/ylfpopoverbackgroundview
Last synced: 2 days ago
JSON representation
support custom PopoverBackgroundView for UIPopoverPresentationController
- Host: GitHub
- URL: https://github.com/leavesster/ylfpopoverbackgroundview
- Owner: leavesster
- License: mit
- Created: 2018-09-24T06:52:59.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-11-03T03:34:26.000Z (about 6 years ago)
- Last Synced: 2025-01-15T13:09:10.040Z (2 days ago)
- Language: Objective-C
- Size: 51.8 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# YLFPopoverBackgroundView
[![CI Status](https://img.shields.io/travis/leavesster/YLFPopoverBackgroundView.svg?style=flat)](https://travis-ci.org/leavesster/YLFPopoverBackgroundView)
[![Version](https://img.shields.io/cocoapods/v/YLFPopoverBackgroundView.svg?style=flat)](https://cocoapods.org/pods/YLFPopoverBackgroundView)
[![License](https://img.shields.io/cocoapods/l/YLFPopoverBackgroundView.svg?style=flat)](https://cocoapods.org/pods/YLFPopoverBackgroundView)
[![Platform](https://img.shields.io/cocoapods/p/YLFPopoverBackgroundView.svg?style=flat)](https://cocoapods.org/pods/YLFPopoverBackgroundView)## Example
To run the example project, clone the repo, and run `pod install` from the Example directory first.
### How to use
use UIPopoverPresentationController as normal, just add :
```vc.popoverPresentationController.popoverBackgroundViewClass = [YLFPopoverNoShadowBackgroundView class];```
```Objective-C
@import YLFPopoverBackgroundView;
...- (void)showPopoverViewController:(UIViewController *)vc sourceView:(UIView *)sourceView
{
vc.preferredContentSize = CGSizeMake(100, 60);
vc.view.backgroundColor = [UIColor brownColor];
vc.modalPresentationStyle = UIModalPresentationPopover;
UIPopoverPresentationController *present = vc.popoverPresentationController;
// just one line code
vc.popoverPresentationController.popoverBackgroundViewClass = [YLFPopoverNoShadowBackgroundView class];
present.delegate = self;
present.sourceView = sourceView;
present.sourceRect = sourceView.bounds;
[self presentViewController:vc animated:YES completion:nil];
}```
## Requirements
For UIPopoverPresentationController, you need iOS 8+.
But for UIPopoverController, you only need iOS 5+.## Installation
YLFPopoverBackgroundView is available through [CocoaPods](https://cocoapods.org). To install
it, simply add the following line to your Podfile:```ruby
pod 'YLFPopoverBackgroundView'
```## Author
leavesster
## License
YLFPopoverBackgroundView is available under the MIT license. See the LICENSE file for more info.