Giter Club home page Giter Club logo

lgalertview's Issues

Dynamic buttons or height

Hello and thanks for sharing this great library.
Its not an issue per se, rather than a question.

I have a custom view with thumbnails which i have successfully added in your control.
What i want to achieve is show the control with only the cancel button until the user has made at least one selection.
I have all the necessary delegates coming from my custom uiview that inform of any selection/deselection of each thumb.
Is there a way to manually show hide buttons to achieve such scenario?
or any other way you can think of that would make better sense with my case?

thanks for your time

Bug: Wrong size while editing UITextField

While editing UITextField with keyboard expanded, tap an UIButton (not calling UITextField's resignFirstResponder) to show an LGAlertView, which results in wrong size.
img_6579

dealloc has a problem

It may show alert many times.if add
-(void)viewWillDisappear:(BOOL)animated
{
_securityAlertView=nil;
}
dealloc will happen

Collaborators WANTED

Guys, sorry, but now I totally don't have enough time to support my repositories. If somebody want to participate I will glad to add him.

And one more thing. If you really want to collaborate, prove your interesting in this library. Star it, fork it, make some issues, pull request. Show me that you understand how it works inside. Or if you do not create any pull request, but really want to improve this library, show me some your ios code and let me see your level.

Custom view implementation vertical margins

So far I was able to eliminate the margins and radiuses using the following:

alertView.offsetVertical = 0;
alertView.cancelButtonOffsetY = 0;
alertView.layerCornerRadius = 0;

But I couldn't find a way to eliminate the top and bottom margins that occurs as shown below:

SS

Is there a way to work this around?

actionHandler problem

why?
actionHandler
from

^(LGAlertView *alertView, NSString *title, NSUInteger index)

to
^(LGAlertView *alertView, NSUInteger index, NSString *title) ;

So unreasonable!!!

Auto dismiss alert

Hi,
I want my alert auto dismiss in x seconds, how can I setup it?
Thanks

Shows black screen after dismiss

I have updated to latest release and it breaks the UI.
I am stuck at black screen when I press cancel on alertview

Here is my Code

LGAlertView* alertView = [[LGAlertView alloc] initWithViewAndTitle:title message:subtitle style:LGAlertViewStyleAlert view:customView buttonTitles:@[kAlertButtonOk] cancelButtonTitle:kAlertButtonCancel destructiveButtonTitle:nil actionHandler:^(LGAlertView * _Nonnull alertView, NSUInteger index, NSString * _Nullable title) {
        if(okBlock){
            okBlock(YES,self.textViewText);
        }
    } cancelHandler:^(LGAlertView * _Nonnull alertView) {
        if (cancelBlock) {
            cancelBlock(YES);
        }
    } destructiveHandler:^(LGAlertView * _Nonnull alertView) {
        
    }];
    [alertView showAnimated:YES completionHandler:nil];

My app is stucked at black screen. Is there any workaround ? It was working fine in some older version.

use LGAlertView with UIAlertView

I don't know if anyone reports this. I just found if I use LGAlertView and UIAlertView together, it always freeze the screen. No touch event or other events are working.

LGAlertView appstore safe

Thanks for sharing your great work.

As you have used some apple's private api call

[NSStringFromClass([window class]) isEqualToString:@"UITextEffectsWindow"])

cancelButtonOffsetY and offsetVertical

#cancelButtonOffsetY does the same work as offsetVertical when the LGA'style is action sheet, they are both set the distance between bottom of the screen and the bottom of the LGA, Here is my code:

alertView.layerCornerRadius = 0.0;
alertView.buttonsFont = [UIFont systemFontOfSize:16];
alertView.cancelButtonFont = [UIFont systemFontOfSize:16];
alertView.buttonsHeight = 48;
alertView.cancelButtonTitleColor = [[UIColor blackColor] colorWithAlphaComponent:0.38];
alertView.buttonsTitleColor = [[UIColor blackColor] colorWithAlphaComponent:0.87];
alertView.cancelButtonOffsetY = 0;
alertView.offsetVertical = 9;

Is there some wrong I made ? 3Q for some help. What I thought is the cancelOffsetY is the distance between cancel button and the function button

iOS 11 Support

Hello.
Has anyone tried LGAlertView on iOS 11 Beta 3? Alert buttons appear deformed in my project. May be someone has investigated height issues already?

EXC_BAD_ACCESS alertView with textField's

iOS 9.0
To reproduce issue:

  1. Init alertView:
 LGAlertView *alertView = [[LGAlertView alloc] initWithTextFieldsStyleWithTitle:@"Some title"
                                                                           message:@"Please, enter some info"
                                                                numberOfTextFields:1
                                                            textFieldsSetupHandler:^(UITextField *textField, NSUInteger index)
                              {
                                      textField.placeholder = @"Some info";
                              }
                                                                      buttonTitles:@[@"Done"]
                                                                 cancelButtonTitle:@"Cancel"
                                                            destructiveButtonTitle:nil
                                                                     actionHandler:nil
                                                                     cancelHandler:nil
                                                                destructiveHandler:nil];

    alertView.cancelOnTouch = NO;
    [alertView showAnimated:YES completionHandler:nil];
  1. Build and run application, show alertView
  2. Tap on textField in alertView - alertView will dismiss
  3. Open one more time alertView and tap cancel - it will crash with exc_bad_access

Issue with Share Extension

i added LGAlertView in pods of Share Extension , but it errors from uiapplication.shared . so i made Require Only App-Extension-Safe api to No. but even after that it shows runtime error (exc_badaccess).

Don't manipulate non-app windows

The lib always hides my non-app key window that I use for my custom controller in action sheet style that I use for photo picker.

UIWindow *keyWindow = LGAlertViewHelper.keyWindow;

[keyWindow endEditing:YES];

if (!hidden && keyWindow != LGAlertViewHelper.appWindow) {
    keyWindow.hidden = YES;
}

iOS 11 Crash after attempt reopen LGAlertView

In first time on screen LGAlertView open successfully.
But when we try to create and show AlertView again the application crashes with the exception:

Terminating app due to uncaught exception 'CALayerInvalidGeometry', reason: 'CALayer position contains NaN: [179.5 nan]

In iOS 10 everything works fine.

- (void)showPeriodSelector {
    self.periodSelectorAlertView = [[LGAlertView alloc] initWithViewAndTitle:NSLocalizedString(kQSPaymentDetailViewController_SelectPeriodTextKey, nil)
                                                                     message:nil
                                                                       style:LGAlertViewStyleActionSheet
                                                                        view:self.periodsTableView
                                                                buttonTitles:nil
                                                           cancelButtonTitle:NSLocalizedString(kQSBegetCommon_CancelTextKey, nil)
                                                      destructiveButtonTitle:nil
                                                                    delegate:nil];
    self.periodSelectorAlertView.tintColor = [QSCustomStyle mainColor];
    [self.periodSelectorAlertView showAnimated];
}

Issue with autolayout

I want to add my own subview from xib which use autolayout constraints, but when _scrollView of your alertView setting frame, _innerView change frame too (autoresize). I temporarily decided the problem in your -layoutInvalidateWithSize: method by saving _innerView frame before setting superview frame, and then set it back.

CGRect innerFrame = _innerView.frame;
_scrollView.frame = scrollViewFrame;
_scrollView.transform = scrollViewTransform;
_scrollView.alpha = scrollViewAlpha;
_innerView.frame = innerFrame;

如果buttonTitles过多的话,会出现拉不到底的情况。

如果buttonTitles过多的话,会出现拉不到底的情况。
代码如下:

NSMutableArray* array = [NSMutableArray new];
        for (int i=1000; i<=200000; i+=1000) {
            [array addObject:IntegerToString(i)];
        }
    LGAlertView* alert = [[LGAlertView alloc] initWithTitle:@"选择目标步数(下拉选择更多)"
                                                     message:nil
                                                       style:LGAlertViewStyleActionSheet
                                                buttonTitles:array
                                           cancelButtonTitle:@"取消"
                                      destructiveButtonTitle:nil
                                                    delegate:self];
    alert.heightMax = 250.f;
    [alert showAnimated:YES completionHandler:nil];

总数是200000,但是只能拉到157000的位置。

click the last Button(lowest) in LGAlertViewStyleActionSheet's buttonTitles,didn't do anything?what's wrong~?please help

eg: LGAlertView *alert = [[LGAlertView alloc] initWithTitle:@"type" message:@"msg" style:LGAlertViewStyleActionSheet buttonTitles:@[@"aliPay",@"weixin"] cancelButtonTitle:@"cancle" destructiveButtonTitle:nil actionHandler:^(LGAlertView *alertView, NSString *title, NSUInteger index) {
NSLog(@"%lu",(unsigned long)index);
} cancelHandler:^(LGAlertView *alertView,BOOL onButton) { } destructiveHandler:^(LGAlertView *alertView) { }];

when i clicked the button named @"weixin" ,but it seems do nothing.then the alert dealloced.

Black Screen problem when using with Swift

Following warning appears on console while running
<UIVisualEffectView 0x7f8883c2bc70> is being asked to animate its opacity. This will cause the effect to appear broken until opacity returns to 1.
Once I show LGAlertView it turns screen into black screen. Following code is used
```
@IBAction func onClickEditProfile(sender: Any) {
let lgaView: LGAlertView = LGAlertView.init(title: "", message: "What would you like to edit?", style: LGAlertViewStyle.actionSheet, buttonTitles: ["Edit Profile", "Edit Schedule"], cancelButtonTitle: "Cancel", destructiveButtonTitle: nil, actionHandler: { (lgView: LGAlertView, index:UInt, title: String) in
if(index == 0){
self.navigationController?.pushViewController(EditProfileVC.editProfileVCLoad(), animated: true)
}else{
self.navigationController?.pushViewController(EditProfileVC.editProfileVCLoad(), animated: true)
}

        } as? LGAlertViewActionHandler, cancelHandler: { (lgView: LGAlertView) in
        lgView.dismissAnimated()
        

    }) { (lgView: LGAlertView) in
        lgView.dismiss()
    }
    lgaView.showAnimated()
}

Prevent alert dismiss.

Is it possible to prevent dialog from dismissing when user touches a button? I want to dismiss dialog manually. Assume I want to add a retry button for dialog so alert view stay open until the job end

LGAlertViewStyle and LGAlertViewWindowLevel enums

You can change declaration of LGAlertViewStyle and LGAlertViewWindowLevel for compatibility with Swift enums to modern Objective-C syntax:

typedef NS_ENUM(NSUInteger, LGAlertViewStyle) {
    LGAlertViewStyleAlert = 0,
    LGAlertViewStyleActionSheet  = 1
};

typedef NS_ENUM(NSUInteger, LGAlertViewWindowLevel) {
    LGAlertViewWindowLevelAboveStatusBar = 0,
    LGAlertViewWindowLevelBelowStatusBar = 1
};

This syntax was introduced with iOS 6.

Can't enable or disable buttons or change properties after alert showed

I have an alert view (with view) that I want to enable or disable it's button under some conditions but I can't do that.

alert.cancleButtonEnabled = YES / NO; 

[alert setCancelButtonEnabled: YES/NO];

[alert setButtonPropertiesAtIndex:0 handler:^(LGAlertViewButtonProperties *properties)
{
    properties.enablde = YES/NO;
}];

None of the above work while the alert is showing.

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.