GithubHelp home page GithubHelp logo

sweetalert-ios's People

Contributors

91haba avatar 9nix00 avatar chrisamanse avatar codestergit avatar mihailsalari avatar tiagomnh 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

sweetalert-ios's Issues

autorezisingMask & buttonType

i am using xcode 6.4
i was not able to compile the project because there was a problem with autoresizing and the button type. i changed the code and it works..

self.view.autoresizingMask = UIViewAutoresizing.FlexibleHeight
let button = UIButton.buttonWithType(UIButtonType.Custom) as! UIButton

thanks for this awesome tiny library

Button title length issue

I noticed that if you set the button titles too long, it causes the button width to extend and look ugly.

Support to Modal Segues

In the function showAlert isn't better to set the "window" (line 253) constant to "UIApplication.sharedApplication().keyWindow?.subviews.last"?

In my application, if I set the "keyWindow" to .first, the alert will be put in the back of a ViewController that is presented modally.

Help with using with Objective-C project

How do I use this in my Objective-C project. It lets me do the :

        SweetAlert *newAlert=[[SweetAlert alloc]init];
        [newAlert showAlert:@"Error"];

but none of the customizing like adding a subtitle or changing the type of alert.
Any help is appreciated. Thanks!

isOtherButton value is wrong

isOtherButton param value is true for first button and false for other button
Function cloaseAlert has line:
let isOtherButton = buttonIndex == 0 ? true: false
But otherButton index is 1 - condition is incorrect

Tap outside the alert to dismiss it

Hello my friend, I have been struggling with this issue and I just can't make it work, I hope you can help me if this is posible or not, I noticed it does work in web and Android, but for some reason I cant find where to make it work in your code, and the function that allows me to do that or a similar one in Android, doesn't exist in this library. Best regards.

Hide Button and automatic dismiss

I am using this and i want to hide OK button from success alert. It should be dismiss by default after 3 seconds or user can set the time.
I didn't get the frame of Button. Please guide me.

Crashing always

Always crashes at line 243
let window: UIWindow = UIApplication.sharedApplication().keyWindow! with error
fatal error: unexpectedly found nil while unwrapping an Optional value

i am calling following code in my viewController in viewDidLoad() method
SweetAlert().showAlert("Good job!", subTitle: "You clicked the button!", style: AlertStyle.Success)

screen shot 2016-02-04 at 17 54 56

`

Make the class a singleton

Wouldn't it better to make the class a singleton so that there is only one instance.
You would then just call functions:

SweetAlert.sharedInstance.showAlert("Here's a message!")

Just need the:
static let sharedInstance = SweetAlert()

and make the init() private.

Very nice work, thanks!!

Custom image not cleaned

If you were to change SweetAlert() to your alert variable across the ViewController, you would notice that the custom image doesn't get cleaned properly.

Example. click the custom image button then check the other alerts.

Better Installation Section

Hey, your library is really interesting.

The only problem I found was the README.md, which needs a better Installation Section
I created this iOS Open source Readme Template so you can take a look on how can improve your Installation Section
If you want, I can help you to organize the lib.

What are your thoughts? ๐Ÿ˜„

Better Installation Section

Hey, your library is really interesting.

The only problem I found was the README.md, which needs a better Installation Section
I created this iOS Open source Readme Template so you can take a look on how can improve your Installation Section
If you want, I can help you to organize the lib.

What are your thoughts? ๐Ÿ˜„

Objective-C project use problem

  • Objective-C programs are using SweetAlert.
  • After the update Xcode 8.3.2.
  • Xcode 2.3 is no longer compatible with Swift version 2.3.
  • then SweetAlert update for Swift grammar version 3.0.
  • In introducing SweetAlert Objectiv - C project, compiled generated Objective-C class
......

#if defined(__has_feature) && __has_feature(modules)
@import UIKit;
#endif

#pragma clang diagnostic ignored "-Wproperty-attribute-mismatch"
#pragma clang diagnostic ignored "-Wduplicate-method-arg"
@class NSCoder;
@class UIButton;
@class NSBundle;

SWIFT_CLASS("_TtC4demo10SweetAlert")
@interface SweetAlert : UIViewController
- (nonnull instancetype)init SWIFT_UNAVAILABLE;
- (nonnull instancetype)initWithCoder:(NSCoder * _Nonnull)aDecoder OBJC_DESIGNATED_INITIALIZER;
- (void)pressed:(UIButton * _Null_unspecified)sender;
- (void)viewWillLayoutSubviews;
- (SweetAlert * _Nonnull)showAlert:(NSString * _Nonnull)title SWIFT_WARN_UNUSED_RESULT;
- (nonnull instancetype)initWithNibName:(NSString * _Nullable)nibNameOrNil bundle:(NSBundle * _Nullable)nibBundleOrNil SWIFT_UNAVAILABLE;
@end


@interface UIColor (SWIFT_EXTENSION(demo))
@end

#pragma clang diagnostic pop
  • Can only use showAlert: API Can't meet the project requirements
  • Then I translated into Objective-C language version
  • If the infringement to you, please contact me, I will delete it
  • SJAlertView

Alert doesn't show in some cases.

I had to change this line:
let window = UIApplication.sharedApplication().keyWindow?.subviews.first as UIView
to this (notice the .last) to get it to work for me from a modally presented view controller within an app.
let window = UIApplication.sharedApplication().keyWindow?.subviews.last as UIView
It seems to work, but I'm not really sure what the correct change should be.

Xcode 6.3 version doesn't compile

Hi
I am trying to run the Xcode version 6.3 for the code but it doesn't compile. IT raises lot of issues related to init and type methods.
I could resolve the type methods error but not init one. Can you help ?
-Randeep

xcode 8 ios 10

Gives that warnings !

ViewController.swift:32:22: Result of call to 'showAlert' is unused
ViewController.swift:38:22: Result of call to 'showAlert(_:subTitle:style:)' is unused

like this about 12 warnings

Relocate above keyboard upon keyboard appearance

If you use SweetAlert on iOS 9 on iPad, the keyboard can appear at any time even if your app didn't initiate it. The keyboard will often cover up the SweetAlert. To resolve this, it should listen for the keyboard will show and will hide notifications and relocate appropriately.

Changing size of the animateView

Hi,
Thanks for sharing the code.
The issue I face is that when we change the size of the animate view the bezirepath that draws the tick of success animate view draws bad.
It seems that the code for drawing this tick is harcoded based on size 70 and when I change the size to 50 it draws bad.

May you please help me how to fix this?

More Cocoapod compatible

Hi,

This is a very nice Alert I'm using in my project, I would like to recommend to structure the project as CocoaPods compatible that should pass all the validations of the command:

pod lib lint SweetAlert.podspec

I've created a branch develop in my fork, if you are interested in a PR (#44).

Thanks,
J.

swift 4.0

/SweetAlert.swift:492:57: 'M_PI' is deprecated: Please use 'Double.pi' or '.pi' to get the value of correct type and avoid casting.

This is cool!

As cool as this is I really don't want to use it in the project I'm working on until there is an 'autoDismiss' option

How can I generate this instance?

I introduced this with cocoapods.

I want to generate this instance with "SweetAlert()".
However, this initializer is internal.
Isn't it impossible?

Support ios9 Multitasking

UIScreen.mainScreen().bounds must be replaced by UIScreen.mainScreen().applicationFrame

will this library be updated in the future?

best regards
Alex

2 inquiries :)

Hi,

First off great work with this. super light weight and works great!! I had two inquiries to ask for

  1. Clear alert after x seconds without button press
    I was wondering if there is any way to clear the alert, x seconds after it pops up. sort of to notify that an action was completed and thats it. Without the users engagement or such.
  2. Custom alert view with activityIndicator
    Also if there is a way to add a loading indicator in the custom image?

Dismiss alert

How to dismiss the alert when user tapped the out side of the alert view ?

Swift3

Any chance on an update for Swift3?

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.