TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Oct 2017 |
Maintained by Paulius Vindzigelskis.
Universal simple popover view to show any kind of content which is subclass of UIView. Works in both - iPhone and iPad. Easy customizable.
Include NGSPopoverView .h and .m files in your target. #import "NGSPopoverView.h" where needed.
Use tintColor property. Default value is white.
NGSPopoverView uses AutoLayout to calculate it's size. Add height (required) and width (optional) constraints to UITableView as it doesn't have intrinsicContentSize property set up.
- (IBAction)buttonPressed:(UIButton *)sender {
UILabel *label = [[UILabel alloc] init];
label.text = @"Some text\nAnd some more";
label.numberOfLines = 0;
NGSPopoverView *popover = [[NGSPopoverView alloc] initWithCornerRadius:10.f
direction:NGSPopoverArrowPositionAutomatic
arrowSize:CGSizeMake(20, 10)];
popover.contentView = label;
[popover showFromView:sender animated:YES];
}
- (IBAction)buttonPressed:(UIButton *)sender {
UILabel *label = [[UILabel alloc] init];
label.text = @"Some text\nAnd some more";
label.numberOfLines = 0;
NGSPopoverView *popover = [[NGSPopoverView alloc] initWithCornerRadius:0.f
direction:NGSPopoverArrowPositionAutomatic
arrowSize:CGSizeMake(20, 10)];
popover.contentView = label;
popover.fillScreen = YES;
[popover showFromView:sender animated:YES];
}
- (IBAction)buttonPressed:(UIButton *)sender {
UILabel *label = [[UILabel alloc] init];
label.text = @"Some text\nAnd some more";
label.numberOfLines = 0;
NGSPopoverView *popover = [[NGSPopoverView alloc] initWithCornerRadius:10.f
direction:NGSPopoverArrowPositionAutomatic
arrowSize:CGSizeMake(20, 10)];
popover.contentView = label;
popover.shouldMaskSourceViewToVisible = YES;
popover.maskedSourceViewCornerRadius = sender.frame.size.width/2.f;
[popover showFromView:sender animated:YES];
}