Coder Social home page Coder Social logo

klcpopup's People

Contributors

jmascia avatar nicopuri 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

klcpopup's Issues

IBAction Don't fire from xib view

Hi
I have a xib file that use KLCPopup for show popup view.
when use view whitout KLCPopup, boutton IBAction fire; but when use KLCPopup boutton IBAction don't fire!
Please Help, Thanks

Dismiss popup using a button

Hello,

I've been using KLCPopup in my project, and I've been trying to dismiss a popup on button click.

Context :
I have a nib with my popup , inside there are 2 buttons (yes, no).
I load my nib into my klcpopup and instantiate it to show on screen

Problem :
When I click on one of the buttons, If I put anything in the IBAction connected to the button in nib, it will crash without telling me one thing in debugger, just gives me a EXC_BAD_ACCESS on AppDelegate class.

code snippets :
my func to show the alert

func showAlertWithButtons(message: String?, title: String?) {
        var nibView = NSBundle.mainBundle().loadNibNamed("buttonAlertView", owner: self, options: nil)[0] as? UIView
        alertTitle.text = title!
        alertMessage.text = message!
        var mainWindow = UIApplication.sharedApplication().keyWindow
        nibView?.frame = CGRectMake(nibView!.frame.origin.x, nibView!.frame.origin.y, mainWindow!.frame.size.width, nibView!.frame.size.height)
        alertPopup = KLCPopup(contentView: nibView, showType: KLCPopupShowType.SlideInFromRight, dismissType: KLCPopupDismissType.GrowOut,
            maskType: KLCPopupMaskType.Dimmed, dismissOnBackgroundTouch: true, dismissOnContentTouch: false)

        alertPopup!.show()
    }

my IBAction

    @IBAction func didClickOnYes(sender : AnyObject)
    {}

my nib
alt text

I tried setuping a nsnotification in my IBAction but it crashes.

Is there a way to dismiss my popup from an IBAction, if so what am I doing wrong ?

dismiss not working with iOS 8, Swift

Hey,

Not sure if it is a bug or I am doing something wrong.

I got this code:

var loadingPopupView = KLCPopup(contentView: LoadingIndicatorPopupView(), showType: KLCPopupShowType.BounceIn, dismissType: KLCPopupDismissType.BounceOut, maskType: KLCPopupMaskType.Dimmed, dismissOnBackgroundTouch: false, dismissOnContentTouch: true)
loadingPopupView.show()
loadingPopupView.dismiss(true)
loadingPopupView.dismiss(false)
KLCPopup.dismissAllPopups()

popup shows but is never hidden. I got another popup which is dismissed via self.dismissPresentingPopup() from inside the view and that seem to work. But when I am trying to dismiss it from outside - it never gets dismissed.

because of dismissOnContentTouch: true it is dismissed by touching on content.

Any ideas ?

Change frame of popup

Hello.
I have popup with X button on top (to dismiss). I also have two text fields in my popup. Whole popup is connected to XIB, and I normally present it. But when I start typing something inside text field, keyboard hides the popup, so I created method :
-(void)textFieldDidBeginEditing:(UITextField *)textField
{
[UIView animateWithDuration:0.6 animations:^{
[self setCenter:CGPointMake(self.superview.frame.size.width/2, 85)];
}];
}
I change center of the popup so it is not hidden under keyboard, but then the X button is not clickable. It looks like the visible popup moved up, and the "clickable area" remains where it was. The X is outside the "clickable area", so I can't interact with it. How to solve it?

ContentView is not removed from superview when dismiss

I declare a global variable(KLCPopup), and find contentView is not remove from popup after dismiss the popup. And show a new contentView by the popup, there are actually two contentViews in the popup.

I know there is a callback(didFinishDismissingCompletion), user can add

   contentView.removeFromSuperView()

into the callback.

But I do not think everyone want to add the extra code.

Is my thought wrong?

AutoLayout does not work

I find the following code in the lib:

  [_containerView removeConstraints:_containerView.constraints];
  [_containerView addConstraints:
   [NSLayoutConstraint constraintsWithVisualFormat:@"V:|[contentView]|"
                                           options:0
                                           metrics:nil
                                             views:views]];

  [_containerView addConstraints:
   [NSLayoutConstraint constraintsWithVisualFormat:@"H:|[contentView]|"
                                           options:0
                                           metrics:nil
                                             views:views]];

It means constraints are used for contentview,but do not set translatesAutoresizingMaskIntoConstraints to false, I think the constraints do not works. translatesAutoresizingMaskIntoConstraints

I think should add the following code:

     [contentView setTranslatesAutoresizingMaskIntoConstraints:NO];

Popup at wrong coordinates after view is dismissed

I first had KLCPopup manually imported into my project and everything worked as desired. Then I decided to switch over and use it through cocoapods and this issue happened.

The popup is allocated from the viewWillAppear it works fine when the viewcontroller is accessed for the first time, but going back on the navigation controller, and accessing the view controller again, the popup is located at (0,0).

Tried this with no luck:
KLCPopupLayout layout = KLCPopupLayoutMake(KLCPopupHorizontalLayoutCenter,KLCPopupVerticalLayoutCenter);

Wrong second animation of popup

First time default configured popup showing normal, but second and others time it's starting from x-something and y-something coords. I think you'll get this bug with no problem.
iPhone and iPad, iOS8

handle the keyboard

When the popview is at bottom, and has a textfield. how can i to avoid the cover over the textfield when begin input?

Opening an MFMailComposeViewController opens under popup

Using the popup to open a MFMailComposeViewController causes the mail view controller to open underneath the popup.

I realize I should probably just dismiss the popup when the controller is shown, but it may be an issue for others so I'm reporting it here.

ios simulator screen shot feb 26 2015 2 37 04 pm

dismissing popup remove view from its superview

First of all, your popup works great! But when it dismissed it also removes view from its superview and I'll need to recreate it at the time of re popup it. Any way to change this behaviour?

Cocoapods!

You should add this to Cocoapods so developers can easily add this library to their projects without having to pull down this repo and drag files over. This is a really cool library, and it'd be awesome to have a pod for it.

KLCPopup view display in full screen

I have open view controller by using KLCPopup.In this view controller contain one button.On click those button i have presently open image picker.Then when dismiss image picker view at that time KLCPopup view display in full screen.

if i set translatesAutoresizingMaskIntoConstraints property to false ,Then when dismiss image picker view at that time KLCPopup view not display.

`.GrowIn` showType animates from the wrong origin after the first time

Love the pod, but I'm having one issue - the first time my popup appears (either when I set .GrowIn explicitly or just don't set it at all) it scales up, correctly, from the center of the screen. Every subsequent time it appears, it scales up from what seems to be the upper left side of the screen. See below:

22222

cocoapods need update!

At first I use Cocoapods to install the KLCPopup in my project, and the version is 1.0...
And then I found that when in iOS8, I rotatie the device from portrait to landscape left, the popupView rotated 180 degrees...
At last, I check the source code and compare with the code in git, IT WAS DIFFERENT!!!!!
And the code in github is working perfect
SO CHEAT YOU PAPA...(坑爹) -,-

By the way, This popup is great, I love it so much! Thank u.

Compile Error: "Function definition is not allowed here" in "New Created Project" of XCode 6

After I created a new project in XCode 6 and import KLCPopup.h, I got the following error:
2014-10-20 8 58 14
This issue is caused by ProjectName-Prefix.pch is not created automatically in Xcode 6, thus the following import is missing:
UIKit/UIKit.h
Foundation/Foundation.h

You can follow the following discussion to add .pch back manually:
http://stackoverflow.com/questions/24158648/why-isnt-projectname-prefix-pch-created-automatically-in-xcode-6

I love KLCPopup! Hope it support keyboard. Thanks!

iOS 8 position issues

Thanks for this amazing popup! I want to put in inside an app that I'm making but with iOS 8 around the corner I was wondering if you are going to fix position problems. Have a look at the screenshot.

Also the fade out animation flickers a bit.

ios simulator screen shot 13 aug 2014 10 49 56

Dismiss on touch always enabled, IF UIView is used as contentView.

I'm fairly certain this is KLCPopup.

When I use UIImageView as the contentView, I can successfully disable the touch to dismiss. I attach a UITapGestureRecognizer to KLC to dismiss on touch.

When I use a UIView as the contentView, touch to dismiss is always enabled, and my UITapGestureRecognizer never gets called.

Switching to UIImageView solves the problem.

One doubt

What do u mean by keyboard show/hide in the TODO list ?

Error when using storyboards

Hey, many thanks for an awesome popup!

I am a fan of designing in the storyboard, and right now I have my content view connected as a Container View on the root view controller. I also have a controller called PopupViewController assigned to the content view. This works fine until I call showWithLayout after dismissing it once. I get an error in KLCPopup.m, line 539, saying that

UIViewControllerHierarchyInconsistency, reason: child view controller:PopupViewController: 0x1104987d0 should have parent view controller:(null) but actual parent is:MainViewController: 0x10a920680

Do you know why this happens?

using dimissOnBackgroundTouch causes issues with keyboard

I ran into an issue where I had a textfield inside a view that was used for the popup. Normally, tapping on text field brings up a keyboard, and if i tap anywhere in the background area (i.e. not on the keyboard, not on the popup view), then the popup is dismissed.

However, if you hit the Home button and send app to the background, then bring it back, and open up a popup again... the second you type your first key on the keyboard, the popup dismisses. It seems this is because it is interpreting tapping on the keyboard as a background tap. I tried looking into it but it seem it's using the core UIView hitTest method, which I guess doesn't account for keyboard taps (but only in the case when app is being revived from background).

I ended up just disabling background touch dismiss as a workaround, but thought I should bring this issue to your attention.

How to change layout after showing

I first showing KLCPopup with KLCPopupVerticalLayoutCenter,and when it is showing,I want to change its layout to KLCPopupVerticalLayoutAboveCenter,how to do that?

Subview doesnt pass the touch forward in case mask type is KLCPopupMaskTypeNone

`- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event {

UIView* hitView = [super hitTest:point withEvent:event];
if (hitView == self) {

// Try to dismiss if backgroundTouch flag set.
if (_shouldDismissOnBackgroundTouch) {
  [self dismiss:YES];
}

// If no mask, then return nil so touch passes through to underlying views.
if (_maskType == KLCPopupMaskTypeNone) {
  return nil;
} else {
  return hitView;
}

} else {

// If view is within containerView and contentTouch flag set, then try to hide.
if ([hitView isDescendantOfView:_containerView]) {
  if (_shouldDismissOnContentTouch) {
    [self dismiss:YES];
  }
 //Shouldn't this code exist here
if (_maskType == KLCPopupMaskTypeNone) {
  return nil;
} 
return hitView;

}
}

`

Using several popups...

Is there a way to show several popups, for example, 4, one after the other, and making the background be dimmed until all popups are finished? Currently, I am using an NSTimer and it dims in and dims out for each popup. Thanks in advance

Need a delegate for didDismiss

I will try to fork it and submit a pull request, but I really want to have a call back so I know when it was dismissed.

How to access currently visible view with KLCPopup?

Suppose, I'm showing a (programmatically created) table view with KLCPopup, now I want to reload that table. Is there a way that I can have access to that table view?

For a note, I am not keep a copy (or reference) of that table view? simply, I don't like to take a ivar for this stuff.

Thanks in advance!

Errors when i press button in my view

Hello guys,

i have always one of these errors (randomly) when i press the button in my view :

With KLCPopup I have always one of these errors (randomly) when i press the button of my view contained in the KLCPopup:

NSInvalidArgumentException', reason: '-[NSISLinearExpression sendPlus:](most of times) bad_access_exc code=1
Here's my code to call the KLCPopup in « FindViewController »

AddFeelingViewController *adf = [self.storyboard instantiateViewControllerWithIdentifier:@"AddFeelingView"];
adf.userTo = [_userFetch objectAtIndex:indexPath.row];
adf.controller = self;
adf.view.frame = CGRectMake(0.0, 0.0, 300.0, 250.0);

KLCPopup *popup = [KLCPopup popupWithContentView:[adf view] showType:KLCPopupShowTypeBounceIn dismissType:KLCPopupDismissTypeBounceOut maskType:KLCPopupMaskTypeDimmed dismissOnBackgroundTouch:YES dismissOnContentTouch:NO];

[popup show];

And here the code called in my « AddFeelingViewController » when i press the button :

  • (void)viewDidLoad {

    [super viewDidLoad];
    score = 0;
    if([_controller isKindOfClass:[FindViewController class]]){

    _controller = (FindViewController*)_controller;
    

    }else{
    _controller = (HomeViewController*)_controller;

    }

  • (IBAction)sendPlus:(id)sender {

    score = 1;

}

Everything is well linked in the storyboard and it only crashes if the buttons are linked.

Have you an idea ?

i am tried to open in klcpopup when tap the object in tableviewcell

i am tried to open in klcpopup when tap the tableviewcell object, its opening well but what happening was its open how many times i click on that object that much times the popup was opened, I am using tap gesture for that to open. Below are my codes,

UITapGestureRecognizer *singleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleSingleTap:)]; singleTap.numberOfTapsRequired = 1; [dot setUserInteractionEnabled:YES]; dot.tag=i; [dot addGestureRecognizer:singleTap];
and in selector:
`
- (void)tapDetected:(UITapGestureRecognizer *)recognizer {

    NSLog(@"single Tap on imageview: %ld",recognizer.view.tag);

    Buypopklc* myViewObject = [[[NSBundle mainBundle] loadNibNamed:@"Buypopklc" owner:self options:nil] objectAtIndex:0];

    myViewObject.delegate=self;

    [myViewObject updatecontrols:selectedlead];

    KLCPopupLayout layout =   KLCPopupLayoutMake((KLCPopupHorizontalLayout)KLCPopupHorizontalLayoutCenter,
                                               (KLCPopupVerticalLayout)KLCPopupVerticalLayoutCenter);

    popuptype = [KLCPopup popupWithContentView:myViewObject
                                      showType:    (KLCPopupShowType)KLCPopupShowTypeBounceInFromBottom
                                   dismissType:(KLCPopupDismissType)KLCPopupDismissTypeBounceOutToBottom
                                      maskType:(KLCPopupMaskType)KLCPopupMaskTypeDimmed
                      dismissOnBackgroundTouch:YES
                         dismissOnContentTouch:NO];

    [popuptype showWithLayout:layout];

}`
here buypopklc was my xib file, hope you will understand please help me to solve this issue.

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.