Git Product home page Git Product logo

sclalertview's Introduction

sclalertview's People

Contributors

abbasmousavi avatar acerbetti avatar amisare avatar amitaib avatar ancloid avatar azulesm avatar changcode avatar cs-diogo-autilio avatar d-32 avatar dogo avatar fernandoreynoso avatar goncharik avatar huylenshu avatar hydr93 avatar idrougge avatar imkevinxu avatar jcavar avatar jusefjames avatar liqiankun avatar lolgear avatar mbelkin avatar michalciolek avatar n1mda avatar nathanwalker avatar portwatcher avatar shannonchou avatar syto203 avatar taylorryan-tti avatar tmm1 avatar wzs 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sclalertview's Issues

background none

how i can make the background transparent,
i mean the dark overlay,
how i can remove it

Within UINavigationController

I've enjoyed working with your repo! Here's a small issue I encountered.

I have a main ViewController that is embedded in a UINavigationController. On that main view, I show an SCLAlertView, using:

SCLAlertView *alert = [[SCLAlertView alloc] init];
 [alert showSuccess:self.navigationController title:@"Title" subTitle:@"Text" closeButtonTitle:nil duration:2.0f];

For the root view controller, I use self.navigationController because I want the SCLAlert's shadow view to cover the title bar and buttons.

Now here comes the issue.

From that view, I present a modal view controller. When I dismiss that window the main view pushes a blank view controller for some reason. This ONLY happens if I've displayed the SCLAlert, THEN display the modal. It doesn't happen if I haven't displayed the SCLAlert before displaying the modal view controller.

Change Title Size

Hi, what is the best way to change title font size (we work with multiples computers and using cocoapods, if I customize the root files, its a problem in another computer)

Thanks.

EXC_BAD_ACCESS (code=1)

I'm having an issue with this.

I'm a big fan of SCLAlertView but i'm having an issue with a section within my code.

I am using the code elsewhere in my project but when using it within another view controller I'm receiving the above error.

It is showing itself within UIImage+ImageEffects.m on line [keyWindow.layer renderInContext:context]; within

  • (UIImage *)convertViewToImage

This is the code I am using to call the alert

SCLAlertView *alert = [[SCLAlertView alloc] init];
UITextField *textField = [alert addTextField:@"Quantity"];
[textField setKeyboardType:UIKeyboardTypeNumberPad];
alert.backgroundType = Blur;
alert.shouldDismissOnTapOutside = YES;
[alert showSuccess:self title:@"Quantity" subTitle:@"Enter Quantity" closeButtonTitle:@"Done" duration:0.0f];

Thanks in advance

Edit: If i leave the alert view standard it works perfectly. It only seems to have an issue when customising the alert where it crashes

SCLAlertView *alert = [[SCLAlertView alloc] init];
UITextField *textField = [alert addTextField:@"Quantity"];
[textField setKeyboardType:UIKeyboardTypeNumberPad];
alert.backgroundType = Blur;
[alert showSuccess:self title:@"Quantity" subTitle:@"Enter Quantity" closeButtonTitle:@"Done" duration:0.0f];

That works fine

Landscape not working on iPad

I was running some tests with the components, and I noticed it doesn't seem to rotate on an iPad using

7.0.4
IPad 3

When it runs in the simulator it works fine, but on the actual device it fails. The tests were performed using the test app. I have included an image from the iPad.
img_0021

I also noticed if I run it in Landscape on my iPhone 5 with the same OS version it too displays the alert in portrait, even while the device is landscape.

Any suggestions?

Awesome work.

Auto window height by subtitle height

  1. Thanks!
  2. please subj, cause sometimes long text field is necessary

upd:
I found scrolling!
But user's window resizing still needed feature as option.

Won't archive - Modules disabled

I can compile great but not in release mode (making an archive for ad-hoc distribution), the compiler says modules are disabled. Do I have a config issue?

"use of '@import' when modules disabled"

Long texts truncated

If I show an alert with some long text, the end is truncated.
Is it possible to either shrink the text size more when needed or preferably expand the height of the alert view to fit the text?

Thanks for this awesome work.

SCLAlertView color

can i specify a uicolor for it,
modifying the UIColor *viewColor; i mean

Change Edit Alert Color

I don't believe that it is possible to change the color of the alert when it contains a UITextField. Maybe it could be changed to a format like that of adding another button, that way a custom alert could be set up and then a UITextField added.

Tickbox enhancement

It would be useful to have to ability to add a tickbox to the alertview allowing the user to select "don't show this again". Ideally with blocks:

//Using Blocks With Validation
[alert addTickbox:@"Don't show again" validationBlock:^BOOL {
BOOL tickboxValue = ....
return tickboxValue;

} actionBlock:^{
// handle successful validation here
}];

Device rotations support

Nice work!

I've just tried 0.4.2 version and looks like it doesn't handle nicely device rotations. Is it something expected at this point? Would be nice to support rotations.
Thanks in advance!

2015-01-21_0105
2015-01-21_01051

Rotating with keyboard

Hi! Nice alert view. But I have an issue on rotating with showed keyboard. Seems, coords calculation is not correct. I use it on iPhone.

does not work with UIPIckview

Thank you for the nice Alert Controller.

When I try to show the alert under PickerView delegate, like the following:

-(void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component{

// if something true I will give a warning to the user
[alert showWarning....];
}
The UIAlertView works under such condition but not SCLAlertView, it displays on the very top of my tableview(should be on top of the pickerView like UIAlertView ), so I see very strange things like the alertView is transparent to the parent view and the PickerView background visible far below ( pickerView is located at the bottom of a long list static tableview cells)

Display in formsheet

The alert will display off-centered if showed from a modal presented in form sheet style on the iPad.

slow

its slow can when it first run
better on second,
can you plz make it faster

Any of the showAnimationType not working

Hi!
Great looking alertview!
But whatever showAnimationType I try to set It always shows as FadeIn.
The hideAnimationType is working correctly though.
Tested on simulator with 7.1 and device with 8.0.2

iPad vs iPhone NavigationBar

Hello,
SCLAlertView is great. I want to implement it in an update for my Swift learning app Swifty.

I noticed that there is a different behavior when showing the alert.
See the attached screenshot for more information!

bug

typedef ActionBlock name confliction

While using other libraries with cocoapods, I've found out the name ActionBlock is conflicted with others. Would you consider adding Prefix to the typedef? like (^ActionBlock)(void) to something like (^SCLActionBLock)(void). Just my 2 cents. Thank you for the great control.

ability to only show one alert

can you plz add a way or option to only show the alert one if there an alert appear,
even if the user trigger an alert

Can i write the code anywhere?

Can i write the code anywhere,not limit to viewController?
i just find the method to add alert view must have a parameter that is viewController's object.

typedef ValidationBlock name conflicting

When SCLAlertView is using with other libraries via cocoapods name ValidationBlock is conflicted. Can you add prefix SCL to it as you did for SCLActionBLock? Thus SCLValidationBlock will be unique.

Podfile update?

Hey Diogo, I'm integrating this using Cocoapods into a new app, and after adding it to my podfile and running pod install everything was pulled in correctly, but did not include the recent changes (validation block) that you merged. Is there an easy way to fix that?

Keyboard & rotation

testing now on simulator for iPhone6.
Run demo app
Choose Show Edit
tap in the textfield. Keyboard appears and the control moves up.
Rotate simulator. The keyboard rotates and hides textfield.
Close the keyboard and you will see the control move downwards to compensate for the
keyboard removal.

thanks for the control by the way ๐Ÿ‘

Now broken on iOS6

Since the introduction of the textContainer definition in SCLAlertView.m which are iOS>7, the app crashes on iOS6.x
_viewText.textContainerInset = UIEdgeInsetsZero;
_viewText.textContainer.lineFragmentPadding = 0;

I could comment these 2 lines, but then the text appears truncated by the button. Any recommendation to workaround the issue?

Alert Moves After Keyboard Dismisses

If an alert with a UITextField triggers another alert (any type), it will move from the center of the view to the bottom when the keyboard disappears. I've provided an example below:

SCLAlertView *alert = [[SCLAlertView alloc] init];
UITextField *textField = [alert addTextField:@"Text Field"];

[alert addButton:@"Done" actionBlock:^(void) {
// Executed when "Done" is pressed.
    if ([*condition goes here*]) {
        SCLAlertView *alert2 = [[SCLAlertView alloc] init];
        alert2.shouldDismissOnTapOutside = YES;
        [alert2 showCustom:self
                     image:[UIImage imageNamed:@"Image Name"]
                    color:[UIColor flatMagentaColor]
                    title:@"Title 2"
                 subTitle:@"Subtitle 2"
         closeButtonTitle:@"Close 2"
                 duration:0.0f];
        // At this point the keyboard would disappear and the alert would slide down to the bottom of the view with it.
    } else {
// Go about your normal business and no bugs appear
    }
}];

[alert showEdit:self
          title:@"Title"
       subTitle:@"Subtitle"
   closeButtonTitle:@"Close"
           duration:0.0f];

The white background view is too long

Hi,

This is superb. Just one thing, when I add buttons, the white background view is too long. How do you get it to end near the end of the last button?

Thanks, Dan.

issue

Issues with a side menu controller

Hi, there's an issue with the control is you try to call it from a side menu or "drawer".

I'm using MFSideMenu and when I call SCLAlertView from the open side menu, the shadow only covers the side view controller's view and the actual alert is displayed off-center.

Hopefully there's an easy way to add in the ability to display the alert in the middle of the window as opposed to the view controller's view. Let me know if I can be of help. I didn't have a lot of time to work on it today, but will check it out another day!

It's an awesome replacement for UIAlertView, I would love to use it!!

Alert Positioning in TableView

When triggering the Alert (which is btw absolutely great) in a TableView, when the tableview is scrolled to the very bottom, the positioning of the alert gets sometimes even out of screen and a weird background effect occurs (see screenshot)... Resigning the first responder and putting the focus back to a textfield which is at the beginning of the tableview doesn't help...

ios simulator screen shot 06 dec 2014 13 02 21
ios simulator screen shot 06 dec 2014 13 02 56

crash on ios6.1

Reason is the boundingRectWithSize call in SCLAlertView.m has to be done on a NSAttributedString object for iOS 6 instead of NSString for iOS7.

A conditional statement makes the trick:

    // Adjust text view size, if necessary
    CGSize sz = CGSizeMake(kWindowWidth - 24.0f, 90.0f);
    NSDictionary *attr = @{NSFontAttributeName:self.viewText.font};

    if([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0){
        NSString *str = subTitle;
        CGRect r = [str boundingRectWithSize:sz options:NSStringDrawingUsesLineFragmentOrigin attributes:attr context:nil];
        CGFloat ht = ceil(r.size.height) + 10;
        if (ht < kTextHeight)
        {
            kWindowHeight -= (kTextHeight - ht);
            kTextHeight = ht;
        }
    } else {
        NSAttributedString *str =[[NSAttributedString alloc] initWithString:subTitle];
        CGRect r = [str boundingRectWithSize:sz options:NSStringDrawingUsesLineFragmentOrigin context:nil];
        CGFloat ht = ceil(r.size.height) + 10;
        if (ht < kTextHeight)
        {
            kWindowHeight -= (kTextHeight - ht);
            kTextHeight = ht;
        }
    }

Backbutton while SCLAlertView is shown causes zombie views

When you have an alert shown, and the back button is clicked to take the User back to the parent view, the entire view controller stays in memory and never goes away. The way you can test this in simulator is to print a line in your deinit or didReceiveMemoryWarning for the child view. You'll notice that child views that pop back to root without an alert shown will deinit, and a line will not print when you didReceiveMemoryWarning. In contrast, if you have a child view with an alert shown and hit back, you will not see the deinit line and didReceiveMemoryWarning will print a line for that child view.

    deinit {
        NSLog("deinit \(self)")
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        NSLog("didReceiveMemoryWarning \(self)")
    }

Improvement: progress dialog

It would be great to have progress dialog too. I can imagine it as determinate/infinite loop in icon place with text.

Issue when displaying alert view in landscape

I noticed that the SCAlertView is pushed to the lower left side of the screen if displayed on an iPhone 4S while in landscape orientation. Other size displays also cause parts of the popup to be hidden off screen.

alertview position issue

I tried using this on one of my apps. It works well in UIViewController but got some issue in location when implementing in UITableViewController. What I did was I modified SCLAlertView.m and set the _backgroundView.frame to CGRectMake(0[x],0[y],vcWidth[width], vcHeight[as height]);. This is just a workaround not sure if you got a better solution. Thanks by the way for this awesome class:)

Without SubTitle?

Hello,
great AlertView! I am just implementing it in my Apps! However, I would like to show alert sometimes without SubTitle. How can I do it, without leaving a large space between Title and the button? To avoid the wasted space, would be great if this can be done/enhanced!
Many Thanks and regards
-Jan

hi, a suggestion of one line about subTitle's height

SCLAlertView.m line 520,
Change from:
NSAttributedString *str =[[NSAttributedString alloc] initWithString:subTitle];
To:
NSAttributedString *str =[[NSAttributedString alloc] initWithString:subTitle attributes:attr];

It can apply the "attr" you have defined.

Thank you for your nice code.

Fade animation for 'Done' button...

I can't seem to be able to apply the fade duration to the default 'Done, 'OK' default button. Whatever I do, I just get an immediate removal from the superview.

Any ideas?

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.