Latest 1.2.0
Homepage https://github.com/PauliusVindzigelskis/NGSPopoverView
License MIT
Platforms ios 7.0, requires ARC
Authors

Version
Build Status
Platform
Language
GitHub license

README

Universal simple popover view to show any kind of content which is subclass of UIView. Works in both – iPhone and iPad. Easy customizable.

Installation

Cocoapods

pod ‘NGSPopoverView’

General

Include NGSPopoverView .h and .m files in your target. #import "NGSPopoverView.h" where needed.

FAQ

  • How to change color of it from white to whatever I need?

Use tintColor property. Default value is white.

  • I added UITableView inside popover, but it shows empty content. What did I do wrong?

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.

Samples

Rounded corners

rounded_corner.png

- (IBAction)buttonPressed:(UIButton *)sender {
    UILabel *label = [[UILabel alloc] init];
    label.text = @"Some textnAnd 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];
}

Fill screen

fill_screen.png

- (IBAction)buttonPressed:(UIButton *)sender {
    UILabel *label = [[UILabel alloc] init];
    label.text = @"Some textnAnd 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];
}

Mask source view with transparency

mask_view.png

- (IBAction)buttonPressed:(UIButton *)sender {
    UILabel *label = [[UILabel alloc] init];
    label.text = @"Some textnAnd 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];
}

Analytics

<img width="88" height="31" border="0"
src="
http://www.hey.lt/count.php?id=ngspopoverview" alt="Hey.lt – Nemokamas lankytojų skaitliukas">

Latest podspec

{
    "name": "NGSPopoverView",
    "version": "1.2.0",
    "summary": "Universal simple popover view to show any kind of content which is subclass of UIView.",
    "homepage": "https://github.com/PauliusVindzigelskis/NGSPopoverView",
    "description": "Universal simple popover view to show any kind of content which is subclass of UIView. Works in both - iPhone and iPad. Easy customizable.",
    "license": "MIT",
    "authors": {
        "Paulius Vindzigelskis": "[email protected]"
    },
    "source": {
        "git": "https://github.com/PauliusVindzigelskis/NGSPopoverView.git",
        "tag": "R1.2.0"
    },
    "platforms": {
        "ios": "7.0"
    },
    "requires_arc": true,
    "source_files": "Pod/Classes/**/*"
}

Pin It on Pinterest

Share This