Giter VIP home page Giter VIP logo

wypopovercontroller's People

Contributors

cbess avatar fdddf avatar gerasim13 avatar hsoi avatar igrandav avatar jhersh avatar ksjun avatar nicolaschengdev avatar scastria avatar shkutkov avatar tspacek avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wypopovercontroller's Issues

Popover coming from a segue is not animated

See DemoSegue app,

file WYPlayersViewController.m at line 51 :

popoverController = [popoverSegue popoverControllerWithSender:sender permittedArrowDirections:WYPopoverArrowDirectionAny animated:YES];

The popover is not animated when it appears even if animated argument is passed to YES.

UIImagePickerController on iPad

Is it possible to use UIImagePickerController with WYPopoverController on iPad?

When I tried to do so, I received the following error:

On iPad, UIImagePickerController must be presented via UIPopoverController

Add property 'modalInPopover' support

modalInPopover

A Boolean value indicating whether the view controller should be presented modally by a popover.

@property(nonatomic, readwrite, getter=isModalInPopover) BOOL modalInPopover
Discussion

The default value of this property is NO. Setting it to YES causes an owning popover controller to disallow interactions outside this view controller while it is displayed. You can use this behavior to ensure that the popover is not dismissed by taps outside the popover controller.

Availability
Available in iOS 3.2 and later.

Declared In
UIPopoverController.h

iOS7 support

The popover does not showing well on iOS7.

It's totally shrinked.

Thanks in advance.

Using UIAppearance prevents dynamic changes

Thanks for a great control. Changes to UIAppearance do unfortunately not apply to existing instances of a control. Thus it is currently not possible to change the colors of a popover while it is shown.

iOS7 content size

It seems there's some extra space between the bottom border and the contentView
with iOS7. The same code works nicely on iOS6.

preferredContentSize is used with iOS7 and contentSizeForViewInPopover on iOS6

ios6 issue

its crashing on ios 6


2013-09-18 10:45:55.021 WYPopoverDemo[4607:c07] -[WYSettingsViewController setPreferredContentSize:]: unrecognized selector sent to instance 0x75c68c0
2013-09-18 10:45:55.027 WYPopoverDemo[4607:c07] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[WYSettingsViewController setPreferredContentSize:]: unrecognized selector sent to instance 0x75c68c0'
*** First throw call stack:

Supporting UINavigationController

When attempting to add a UINavigationController to the popover it will appear, however any push of a viewController ( [self performSegueWithIdentifier:@"segueName" sender:self]) will fail to do anything.

Any ideas?

Cheers

Is iOS 5.1 supported - setDrawsAsynchronously?

I appreciate your prompt support. Great for overtime.

I have just upgrade to 0.1.2 for issue #15. Now the following exception is occurring.

-[CALayer setDrawsAsynchronously:]: unrecognized selector sent to instance 0xa416480
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[CALayer setDrawsAsynchronously:]: unrecognized selector sent to instance 0xa416480'

self.layer.drawsAsynchronously = YES;

iOS 6 only now?

Cheers

When the keyboard over laps the popover

Hi,

Great library. I'm using this in my second project. In this one however, I have run in to a small situation. The popover I'm displaying is fairly long. Therefore when the keyboard comes up, it overlaps the popover.

As a solution, I added a UIScrollView to the popover and in viewDidLayoutSubviews mthod, I set its its contentSize and frame. Like so

self.scrollView.contentSize = CGSizeMake(self.view.frame.size.width, self.scrollView.frame.size.height);
self.scrollView.frame = self.view.frame;

This almost works. The scrollview works as expected but there's a small hitch. The scrollview doesn't cover the entire popover screen.
screen shot 2014-02-02 at 8 30 33 pm
Notice the first textfield disappearing from the middle of the screen.

I have a demo project here if this is all too confusing.
https://www.dropbox.com/s/gfcp5q364z4k968/PopoverTest.zip

Can you please take a look at it and tell me how to correct this? I'd really appreciate it.

Thank you.

Usage as custom dialog popup?

Whenever I needed a custom modal popup dialog, I would always customize UIAlertView. This leads to trouble since it is not supported and Apple always changes the innerworkings of UIAlertView causing my customizations to break with every iOS release. Therefore, I started looking at thirdparty popover controllers (to gain iPhone support) and found this one. It looks and works great. However, when I want to present it, I must specify some barbutton or view rect to anchor it to. In order to use this popover controller as more of a general purpose custom dialog popup, it would be nice if there was a new WYPopoverArrowDirection.None and the ability to show it without referencing some anchor point. The None arrow direction would mean do not show an arrow AND center the dialog on the screen. I can achieve the hidden arrow by setting the arrowHeight = 0, but I can't find an easy way to just center the popover on the screen. Could this enhancement be added? It sounds easy.

WYPopoverController crashes if areas array is empty

Crashes on this line:

arrowDirection = ((WYPopoverArea*)[areas objectAtIndex:0]).arrowDirection;

This happens for me when I set the popoverContentSize

Also, ideally the ([areas count] > 1) check should be extended.

NSStringFromOrientation and GetStatusBarHeight should be marked as static

The methods
NSString* NSStringFromOrientation(NSInteger orientation)
and
CGFloat GetStatusBarHeight()

generate a warning "No previous prototype for function" because the 'static' keyword is missing.

To fix these warnings, the static keyword needs to be added:
static NSString* NSStringFromOrientation(NSInteger orientation)
static CGFloat GetStatusBarHeight()

Using UINavigationController as ContentViewController

This doesn't seem to work for me.

CCRootViewController *ccrvc = [[CCRootViewController alloc] init];
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:ccrvc];
self.popoverController = [[WYPopoverController alloc] initWithContentViewController:navController];
self.popoverController.delegate = self;
[self.popoverController presentPopoverFromRect:self.bounds inView:self permittedArrowDirections:WYPopoverArrowDirectionAny animated:YES];

Has iOS5 support been removed from the pod?

Performing a pod update generates the following error.

[!] The platform of the target Pods (iOS 5.1) is not compatible with WYPopoverController (0.1.4) which has a minimum requirement of iOS 6.0.

No Podspec

@nicolaschengdev, the last commit removed the Podspec, making it impossible to do
pod 'WYPopoverController', :git => 'https://github.com/nicolaschengdev/WYPopoverController'

WYPopoverController is shown 'behind' a UIViewController that is presented modal with 'UIModalPresentationPageSheet'

Hello guys,

I stumbled upon this component 2 days ago and it would fit my requirements perfectly, but I am not getting it running in my scenario.

I built a very simple test case:

  • I have a button im my main view, that opens up an UIViewController with 'UIModalPresentationPageSheet' presentation style.
  • Inside this modal view Controller there is another button, which should open up the WYPopoverController.
  • When I touch that button, the WYPopoverController is shown 'behind' the modal view controller.

What am I doing wrong? Is there a bug or did I forget some configuration? Could anyone help me out on this one? I would really like to use this component.

Thanks in advance,
SlimShady0208

selecting a parent view(rootView)

Thanks for a great control!
It seems to me there is a small issue in

- (UIView *)rootView
{
    UIWindow *result = [[UIApplication sharedApplication] keyWindow];

    if (result.subviews.count > 0)
    {
        result = [result.subviews lastObject];
    }

    return result;
}

It's not good idea to select blindly last view from a window as an parent. At least it should be checked for visibility etc. But I think to move rootView property to the public interface is a better approach: if a user does not set this property then select something from window's subviews.

Thanks!

Navigation bar appearance weird when it is hidden.

Hi,

I've started to use WYPopover in my project a few months ago. Everything works fine until I try to put my view controller in a navigation controller.

I need to push another view controller, but I don't need navigation bar in first view controller.
So I set 'top bar' property of the navigation controller to none. However, there is something wrong with the navigation bar.

Here I use the demo project 'DemoSegue' as an example.
Normal
normal

Hide Navigation Bar
abnormal

It can be seen that there is a weird gray line above the bottom part of 'Player Name'.

Since the background is white, so the problem is not obvious. I changed the background color to make it more obvious.

abnormal-1

Is this a bug, or I was using it in a wrong way?

Nothing shown when user click outside the window without using the Done button to close

I am using this code just like the one in the Demo:

- (IBAction)showpopover:(id)sender
{
    if (settingsPopoverController == nil)
    {
        UIView* btn = (UIView*)sender;

        WYSettingsViewController *settingsViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"WYSettingsViewController"];

        if ([settingsViewController respondsToSelector:@selector(setPreferredContentSize:)]) {
            settingsViewController.preferredContentSize = CGSizeMake(280, 200);             // iOS 7
        }
        else {
            settingsViewController.contentSizeForViewInPopover = CGSizeMake(280, 200);      // iOS < 7
        }

        settingsViewController.title = @"Settings";
        [settingsViewController.navigationItem setRightBarButtonItem:[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(done:)]];

        settingsViewController.modalInPopover = NO;

        UINavigationController* contentViewController = [[UINavigationController alloc] initWithRootViewController:settingsViewController];

        settingsPopoverController = [[WYPopoverController alloc] initWithContentViewController:contentViewController];
        settingsPopoverController.delegate = self;
        settingsPopoverController.passthroughViews = @[btn];
        settingsPopoverController.popoverLayoutMargins = UIEdgeInsetsMake(10, 10, 10, 10);
        settingsPopoverController.wantsDefaultContentAppearance = NO;

        [settingsPopoverController presentPopoverFromRect:btn.bounds
                                                   inView:btn
                                 permittedArrowDirections:WYPopoverArrowDirectionAny
                                                 animated:YES
                                                  options:WYPopoverAnimationOptionFadeWithScale];
    }
    else
    {
        [self done:nil];
    NSLog(@"test");
    }
}

#pragma mark - Selectors

- (void)done:(id)sender
{
    [settingsPopoverController dismissPopoverAnimated:YES];
    settingsPopoverController.delegate = nil;
    settingsPopoverController = nil;
}

#pragma mark - WYPopoverControllerDelegate

- (BOOL)popoverControllerShouldDismissPopover:(WYPopoverController *)controller
{
    return YES;
}

- (void)popoverControllerDidDismissPopover:(WYPopoverController *)controller
{
    if (controller == settingsPopoverController)
    {
        settingsPopoverController.delegate = nil;
        settingsPopoverController = nil;
    }
}

Notice that I have placed a NSLog(@"test"); under the self done, your demo has not gone and displayed that line in the log (expected behaviour). However, mine does when user did not use the Done button to close the Popover. What other codes am I missing? How can I rectify this?

Using a storyboard identifier - drops UINavigationController

I have the following code.

UINavigationController navigationController = [[UINavigationController alloc] initWithRootViewController: [self.storyboard instantiateViewControllerWithIdentifier:name]];
UIViewController *contentViewController = navigationController;
WYPopoverController
popoverController = [[WYPopoverController alloc] initWithContentViewController:contentViewController];
popoverController.delegate = self;
[popoverController presentPopoverFromRect:view.bounds inView:view permittedArrowDirections:WYPopoverArrowDirectionAny animated:YES];

The controller loaded via the storyboard called is a UITableViewController. The UITableViewController is loaded, however any future calls to push additional view controllers within this wrapped controller results in the following error.

Exception - Could not find a navigation controller for segue 'selectCategory'. Push segues can only be used when the source controller is managed by an instance of UINavigationController.

It is like the controller within the popover has dropped the UINavigationController.

Add '-popoverController:willRepositionPopoverToRect:inView:' support on delegate

-popoverController:willRepositionPopoverToRect:inView:

Tells the delegate that the popover controller needs to change the popover’s location in its view.

- (void)popoverController:(UIPopoverController *)popoverController willRepositionPopoverToRect:(inout CGRect *)rect inView:(inout UIView **)view
Parameters

popoverController
The popover controller changing the position of its content.

rect
On input, the proposed rectangle for the popover. This popover is in the coordinate space of the view in the view parameter. If you want to propose a different rectangle for the popover, put the new value in this parameter.

view
On input, the proposed view for containing the popover. If you want to propose a different view for the popover, put the new view in this parameter.

Discussion

For popovers that were presented using the presentPopoverFromRect:inView:permittedArrowDirections:animated: method, the popover controller calls this method when the interface orientation changes. Your delegate can use this method to adjust the proposed position of the popover. The popover controller does not call this method if you presented the popover from a bar button item.

Availability

Available in iOS 7.0 and later.

Declared In

UIPopoverController.h

iOS7 Support?

The WYPopoverController has graphical glichtes in iOS7. Is it planned to Support iOS7 as well?

Thanks for your Help!

WYPopoverController does not conform to UIAppearanceContainer

WYPopoverController does not conform to UIAppearanceContainer. I'm using pod 'WYPopoverController', '~> 0.1.7' on 7.1 (b3).

Calling something like the following causes crash:
UINavigationBar* navBarInPopoverAppearance = [UINavigationBar appearanceWhenContainedIn:[UINavigationController class], [WYPopoverController class], nil];

Fix:
Add protocol to class header: @interface WYPopoverController : NSObject

Popover never fadeout

For WYPopoverController.m, I think it is better to change the codes in the if statements from line 1395 to the following:

[UIView animateWithDuration:0.15 animations:^{
overlayView.alpha = 0;
} completion:^(BOOL finished) {
completionBlock(YES);
[viewController viewWillDisappear:YES];
}];

Showing the popover from the accessoryView in UITableViewCell

Hi Nicolas,

I have run into another problem. I want to display the popover when the UITableViewCell's accessoryView is tapped on. I have all the code and the views set up right. I checked by displaying it from a UIBarButtonItem. Even from a UITableViewCell, it displays the popover but not when you tap on the accessoryView.

Can you please tell me how I can do this?

I have a runnable Xcode project here.
https://www.dropbox.com/s/g10cu5unmswdn72/PopoverfromtableviewTest.zip

Many thanks as always.

Arrow doesn't get the Navigation bar's background color

My app is a storyboard app and I'm presenting it using WYStoryboardPopoverSegue (like in the DemoSegue project in the example projects). The view controller is embedded in a UINavigationBarController so a a navigation bar appears in the popover view as intended.

Somehow that navigation bar wouldn't conform to the UAppearence proxy I had set up in the app's AppDelegate file. Therefore I changed its background color from in the popover's viewDidLoad method and it works. But the arrow still appears in default color.

screen shot 2014-02-04 at 10 44 13 am

How can I change the arrow's color as well?

I tried making an instance of WYPopoverBackgroundView to set its values and see but I don't know where I should assign the WYPopoverBackgroundView's instance to the popover.

Thank you

viewWillDisappear is being called twice.

I remove observers on the viewWillDisappear. When tapping outside the popup or on the done button the viewWillDisappear is triggered twice. In my case the app. crashes due to the observer is already removed.

Reproduce. add WYSettingsViewController to view the message being called twice.

  • (void) viewWillDisappear:(BOOL)animated {
    NSLog(@"viewWillDisappear");
    }

Visual glitch when borderWidth property set to 0

Setting the borderWidth property to 0 results in a visual glitch at the bottom of the popover.
wypopover

[[WYPopoverBackgroundView appearance] setBorderWidth:0]

Ideally if outerCornerRadius > 0 and borderWidth == 0, the outerCornerRadius is used in the bottom of the popover so that a rounded corner is possible.

'contentSizeForViewInPopover' is deprecated in iOS 7

Hi,

The master works pretty fine on iOS 7 👍

But there are still warnings popped out suggesting using UIViewController.preferredContentSize instead. I am thinking of a possible workaround which will check if the view controller respond to preferredContentSize first. If not, then fallback to use contentSizeForViewInPopover.

Work with InAppSettingsKit?

Anyone pops an IASKAppSettingsViewController InAppSettingsKit inside WYPopoverController successfully? I following the UINavigationController sample:

    UINavigationController* navigationController = [[UINavigationController alloc] initWithRootViewController:self.infoViewController];
    UIViewController* contentViewController = navigationController;

    WYPopoverController* popoverController = [[WYPopoverController alloc] initWithContentViewController:contentViewController];
    popoverController.delegate = self;
    [popoverController presentPopoverFromRect:self.infoButton.bounds
                                       inView:self.infoButton
                     permittedArrowDirections:WYPopoverArrowDirectionAny animated:YES];

but second-level IASKAppSettingsViewControllers are not pushed as expected.

Appereance proxy

Hi. I was trying to customize the popover appearance but it seems that the proxies are implemented in an internal view not exposed with public API. I'm missing something?

regards,
MB

Add animation Option to dismiss

Hi,

Thank you for your great work, I really like it!
One issue: If I show the popover I can add an option how it should be animated, unfortunately this is not possible if I dismiss the popover.

Bests,
Philip

rootView some times problem in this place of logic.

Probably it will be great not only check for if(!view.isHidden) because when I use hud it's the first element :) Maybe it will be better to check for [view isKindOfClass:UIViewController] ?

  • (UIView *)rootView
    {
    UIWindow *result = [[UIApplication sharedApplication] keyWindow];

    if (result.subviews.count > 0)
    {
    for (UIView *view in result.subviews)
    {
    if(!view.isHidden)
    {
    return view;
    }
    }
    // result = [result.subviews lastObject];
    }

    return result;
    }

Minimum requirement of iOS 7.0

It seems that now we cannot use WYPopoverControl on iOS 6 via CocoaPods, because of this line:

s.ios.deployment_target = '7.0'

Is it mistake?

ios5.0

Why was ios5.1 chosen instead of ios5.0 in the podspec?

on the other hand i get this,

[!] The platform of the target Pods (iOS 5.1) is not compatible with WYPopoverController (0.1.7) which has a minimum requirement of iOS 6.0.

but the podspec specifies 5.1 as deployment target

implicit retain of 'self' within blocks

There are numerous places in the WYPopoverController code where 'self' is being implicitly retained.

Enable the compiler warning: "Implicit retain of 'self' within blocks" (CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF, -Wimplicit-retain-self) and you'll see them.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.