Cool AlertView

Overview

AMSmoothAlert

• Now include multiple buttons feature you asked :)

• Now available on Cocoapods : AMSmoothAlert

I saw this pretty cool alert view concept on Dribbble so i decided to reproduce it !

Screen1

(the above gif is slower than the real speed animation)

##Installation Cocoapods

Add this in your Podfile

pod 'AMSmoothAlert', '~> 1.0'

It uses :

  • GPUImage Framework

Please note that GPUImage doesn't support arm64 devices yet.

##Easy to use !

AMSmoothAlertView *alert = [[AMSmoothAlertView alloc]initWithTitle:@"Congrats !" 
        andText:@"You've just displayed this awesome alert view !" 
        forAlertType:AlertSuccess];

Main methods :

//initialisation with a Title and a Text message
//drop animation init
- (id) initDropAlertWithTitle:(NSString*) title andText:(NSString*) text andCancelButton: BOOL)hasCancelButton forAlertType:(AlertType) type;
- (id) initDropAlertWithTitle:(NSString*) title andText:(NSString*) text andCancelButton:(BOOL)hasCancelButton forAlertType:(AlertType) type andColor:(UIColor*) color;

//fade in animation init
- (id) initFadeAlertWithTitle:(NSString*) title andText:(NSString*) text andCancelButton:(BOOL)hasCancelButton forAlertType:(AlertType) type;
- (id) initFadeAlertWithTitle:(NSString*) title andText:(NSString*) text andCancelButton:(BOOL)hasCancelButton forAlertType:(AlertType) type andColor:(UIColor*) color;

//set corner radius or not on the alertView
- (void) setCornerRadius:(float)cornerRadius;
//show the alertview!
- (void) show;
//dismiss it !
- (void) dismissAlertView;

Support completion blocks

alert.completionBlock = ^void (AMSmoothAlertView *alertObj, UIButton *button) {
        if(button == alertObj.defaultButton) {
                NSLog(@"Default");
        } else {
                NSLog(@"Others");
        }
};

You can edit title and text fonts, circle icon, colors and the "ok" button (multiple button feature is coming soon).

//title font customization
[alert setTitleFont:[UIFont fontWithName:@"Verdana" size:25.0f]];
//text message font customization
[alert setTextFont:[UIFont fontWithName:@"Futura-Medium" size:13.0f]];
//icon customization
[alert.logoView setImage:[UIImage imageNamed:@"checkMark.png"]];

Three types of alert views (for now)

typedef enum AlertType : NSInteger AlertType;
enum AlertType : NSInteger {
    AlertSuccess,
    AlertFailure,
    AlertInfo
};

##Incoming improvements

  • KVO bindings (change the button label for example)
  • performances
  • more customisation
  • more circles + icons
  • more animations

Also check out my other controller AMLoginViewController

@Toinetoine75

Antoine

Comments
  • Cocoapods GPUImage

    Cocoapods GPUImage

    Why in cocoapodspec you've added GPUImage framework if you have previously marked it as dependency, and resolving this dependency leads to downloading source of GPUImage, not framework.

    opened by badeleux 7
  • Compile error on iOS 8 device

    Compile error on iOS 8 device

    Undefined symbols for architecture arm64: "OBJC_CLASS$_GPUImageiOSBlurFilter", referenced from: objc-class-ref in AMSmoothAlertView.o ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

    opened by normalnotebook 4
  • Pod install warning/error

    Pod install warning/error

    [!] Unable to read the license file [pathTo]/Pods/AMSmoothAlert/LICENSE for the spec AMSmoothAlert (1.0)

    Can you fix this? It seems that tag points to a commit that does not have the LICENSE file.

    Thank you in advance, Carmen

    opened by carmenalbu 4
  • #8 - Add delegates for alertViewWillShow, alertViewDidShow, alertViewWil...

    #8 - Add delegates for alertViewWillShow, alertViewDidShow, alertViewWil...

    ...lDismiss, alertViewDidDismiss

    Since the AMSmoothAlertView isn't a straight drop-in replacement of UIAlertView, these will come in handy, for example, when certain UI components need component.enabled = NO, especially if that component triggers an alert, because multiple alerts will just start stacking on top of each other.

    Since the keyboard stays on top of the blurred image view, if I hit "Go" on the keyboard and that triggers an alert, I can inadvertently make a bunch of AMSmoothAlertViews start appearing and make an ugly stack of them.

    opened by evliu 3
  • Planned delegates

    Planned delegates

    Did you plan on adding delegates in place of ones like -(void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex;? Thx!

    opened by evliu 3
  • GPUImage.framework

    GPUImage.framework

    I just tried it with the newest GPUImage framework and it works except the check mark doesn't appear after the alert drops. Tested on my 5s. Maybe just need to update the framework? Or are there other issues I'm not familiar with?

    opened by evliu 3
  • Refactoring

    Refactoring

    I have done some clean up. I hope you don't mind.

    I have made the block callbacks in line blocks. I have limited the number of init methods to a sensible level I think.

    opened by ghost 2
  • Show message by half - IOS 8.4 / Iphone 5S

    Show message by half - IOS 8.4 / Iphone 5S

    screen shot 2015-07-13 at 12 12 38

    The code is...

    AMSmoothAlertView *alert_ = [[AMSmoothAlertView alloc]initFadeAlertWithTitle:@"Sorry !" andText:@"You've just displayed this awesome alert view !" andCancelButton:NO forAlertType:AlertFailure];
                     [alert_ show];
    

    Whats can I do ?

    opened by diogo10 0
  • issue #8 - [self dismissAlertView] inside handleButtonTouched:

    issue #8 - [self dismissAlertView] inside handleButtonTouched:

    I was doing addTarget for dismissing the alertView rather than dismissing the alertView, haha. We can add more functionality and refactor it to be much cleaner going forward

    opened by evliu 0
  • fix AlertType warning; simplize code

    fix AlertType warning; simplize code

    1. animationType is a AlertType, not AlertType *
    2. The following two functions (initDropAlertWithTitle:andText:forAlertType: and initFadeAlertWithTitle:andText:forAlertType: ) are similar, the only difference is to set the animation type, so I abstract the same code in a private function _initViewWithTitle:andText:forAlertType:
    opened by liaojinxing 0
  • In IOS 9.3.1 arm 64 error?

    In IOS 9.3.1 arm 64 error?

    HI I am working with This Lib. before this it is working fine. Now i am facing one issue regarding versions. I just update my iphone to 9.3.1 when i debug i am getting below error Undefined symbols for architecture arm64: "_OBJC_CLASS_$_GPUImageiOSBlurFilter", referenced from: objc-class-ref in AMSmoothAlertView.o ld: symbol(s) not found for architecture arm64 It is working fine in Ios 9.2 How to resolve This please help me.

    opened by bintu1234 0
  • Demo run error!

    Demo run error!

    Undefined symbols for architecture arm64: "OBJC_CLASS$_GPUImageiOSBlurFilter", referenced from: objc-class-ref in AMSmoothAlertView.o ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

    opened by MrsYang 0
  • Correct the spelling of CocoaPods in README

    Correct the spelling of CocoaPods in README

    This pull requests corrects the spelling of CocoaPods 🤓 https://github.com/CocoaPods/shared_resources/tree/master/media

    opened by ReadmeCritic 0
  • Crash Issue

    Crash Issue

    I am trying to integrate that library into my project but at anytime I call this function, it crash my app AMSmoothAlertView *ale = [[AMSmoothAlertView alloc]initFadeAlertWithTitle:NSLocalizedString(@"Database Error", nil) andText:NSLocalizedString(@"Database is not created normally", nil) andCancelButton:YES forAlertType:AlertFailure]; [ale show];

    ----------------------------Log-------------------------------- *** Assertion failure in -[GPUImagePicture initWithCGImage:smoothlyScaleOutput:], /Pods/GPUImage/framework/Source/iOS/GPUImagePicture.m:74 Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Passed image must not be empty - it should be at least 1px tall and wide' *** First throw call stack: ( 0 CoreFoundation 0x02e5d1e4 exceptionPreprocess + 180 1 libobjc.A.dylib 0x02bdc8e5 objc_exception_throw + 44 2 CoreFoundation 0x02e5d048 +[NSException raise:format:arguments:] + 136 3 Foundation 0x0085e4de -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 116 0x000c7a40 -[GPUImagePicture initWithCGImage:smoothlyScaleOutput:] + 624 0x000c766a -[GPUImagePicture initWithCGImage:] + 90 0x000c4f46 -[GPUImageOutput newCGImageByFilteringCGImage:] + 102 0x000c5288 -[GPUImageOutput imageByFilteringImage:] + 120 0x00068b66 -[AMSmoothAlertView performScreenshotAndBlur] + 102 0x000687c1 -[AMSmoothAlertView alertPopupView] + 1249 0x000681a5 -[AMSmoothAlertView _initViewWithTitle:andText:andCancelButton:forAlertType:andColor:] + 837 0x000675c4 -[AMSmoothAlertView initFadeAlertWithTitle:andText:andCancelButton:forAlertType:andColor:] + 340 0x000673f8 -[AMSmoothAlertView initFadeAlertWithTitle:andText:andCancelButton:forAlertType:] + 200 0x0001e0c5 -[AppDelegate application:didFinishLaunchingWithOptions:] + 821 14 UIKit 0x010ce14f -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 309 15 UIKit 0x010ceaa1 -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1810 16 UIKit 0x010d3667 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 824 17 UIKit 0x010e7f92 -[UIApplication handleEvent:withNewEvent:] + 3517 18 UIKit 0x010e8555 -[UIApplication sendEvent:] + 85 19 UIKit 0x010d5250 _UIApplicationHandleEvent + 683 20 GraphicsServices 0x04262f02 _PurpleEventCallback + 776 21 GraphicsServices 0x04262a0d PurpleEventCallback + 46 22 CoreFoundation 0x02dd8ca5 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION + 53 23 CoreFoundation 0x02dd89db __CFRunLoopDoSource1 + 523 24 CoreFoundation 0x02e0368c __CFRunLoopRun + 2156 25 CoreFoundation 0x02e029d3 CFRunLoopRunSpecific + 467 26 CoreFoundation 0x02e027eb CFRunLoopRunInMode + 123 27 UIKit 0x010d2d9c -[UIApplication _run] + 840 28 UIKit 0x010d4f9b UIApplicationMain + 1225 0x0002379d main + 141 30 libdyld.dylib 0x033c9701 start + 1 )

    Sorry for the long log but it is the problem. Please suggest me how to fix

    opened by purepure 1
  • add input text or custom view

    add input text or custom view

    This is really cool library, but it will be better if we can embed textfield or a custom view inside it

    Hope this lib can be done with this feature in near future

    opened by purepure 0
Releases(1.1)
Owner
Antoine Marliac
iOS/tvOS Developer
Antoine Marliac
FCAlertView is a Flat Customizable AlertView for iOS (Written in Objective C)

FCAlertView FCAlertView is a Flat Customizable AlertView, written in Objective C Quick Links 1. Swift 2. Installation 3. Example App 4. Adding FCAlert

Nima Tahami 794 Nov 29, 2022
Simple Alert View written in Swift, which can be used as a UIAlertController. (AlertController/AlertView/ActionSheet)

DOAlertController Simple Alert View written in Swift, which can be used as a UIAlertController replacement. It supports from iOS7! It is simple and ea

Daiki Okumura 406 Sep 5, 2022
FCAlertView is a Flat Customizable AlertView for iOS (Swift)

FCAlertView FCAlertView is a Flat Customizable AlertView, written in Swift [![CI Status](http://img.shields.io/travis/Nima Tahami/FCAlertView.svg?styl

Kris Penney 114 Apr 19, 2022
AlertView A pop-up framework, Can be simple and convenient to join your project.

RAlertView AlertView A pop-up framework, Can be simple and convenient to join your project. Warning content Installation Depend on the project Masonry

杜耀辉 71 Aug 12, 2022
A simple and attractive AlertView to ask permission to your users for Push Notification.

A simple and attractive AlertView **to ask permission to your users for Push Notification.** PRESENTATION Ask permission to user for push notification

Boisney Philippe 37 Mar 23, 2022
FloatingActionSheetController is a cool design ActionSheetController library written in Swift2.

FloationgActionSheetController FloatingActionSheetController is a cool design ActionSheetController library written in Swift2. Overview Requirements X

Ryo Aoyama 141 Oct 30, 2022
Highly customizable alertview and alert/notification/success/error/alarm popup written in Swift

CDAlertView is highly customizable alert popup written in Swift. Usage is similar to UIAlertController. Screenshots Animations Usage Basic usage witho

Candost Dagdeviren 1.1k Dec 30, 2022
FCAlertView is a Flat Customizable AlertView for iOS (Written in Objective C)

FCAlertView FCAlertView is a Flat Customizable AlertView, written in Objective C Quick Links 1. Swift 2. Installation 3. Example App 4. Adding FCAlert

Nima Tahami 794 Nov 29, 2022
Simple Alert View written in Swift, which can be used as a UIAlertController. (AlertController/AlertView/ActionSheet)

DOAlertController Simple Alert View written in Swift, which can be used as a UIAlertController replacement. It supports from iOS7! It is simple and ea

Daiki Okumura 406 Sep 5, 2022
FCAlertView is a Flat Customizable AlertView for iOS (Swift)

FCAlertView FCAlertView is a Flat Customizable AlertView, written in Swift [![CI Status](http://img.shields.io/travis/Nima Tahami/FCAlertView.svg?styl

Kris Penney 114 Apr 19, 2022
AlertView A pop-up framework, Can be simple and convenient to join your project.

RAlertView AlertView A pop-up framework, Can be simple and convenient to join your project. Warning content Installation Depend on the project Masonry

杜耀辉 71 Aug 12, 2022
A simple and attractive AlertView to ask permission to your users for Push Notification.

A simple and attractive AlertView **to ask permission to your users for Push Notification.** PRESENTATION Ask permission to user for push notification

Boisney Philippe 37 Mar 23, 2022
A simple and attractive AlertView to onboard your users in your amazing world.

AlertOnboarding A simple and attractive AlertView to onboard your users in your amazing world. PRESENTATION This AlertOnboarding was inspired by this

Boisney Philippe 832 Jan 8, 2023
Use any custom view as custom callout view for MKMapView with cool animations. Use any image as annotation view.

MapViewPlus About MapViewPlus gives you the missing methods of MapKit which are: imageForAnnotation and calloutViewForAnnotationView delegate methods.

Okhan Okbay 162 Nov 16, 2022
Cool Animated music indicator view written in Swift

Cool Animated music indicator view written in Swift. ESTMusicIndicator is an implementation of NAKPlaybackIndicatorView in Swift for iOS 8. 本人著作的书籍《La

Aufree 465 Nov 28, 2022
CHIPageControl is a set of cool animated page controls to replace boring UIPageControl.

CHIPageControl is a set of cool animated page controls to replace boring UIPageControl. We were inspired by Jardson Almeida dribbble sh

Chili Labs 3.1k Jan 4, 2023
building cool stuff with swiftui

Featured ✨ Clubhouse Drop-in audio chat View source code ?? View Figma design ?? Watch me build ?? Spotify Clone Music app View source code ?? Tinder

Franck Ndame 562 Dec 28, 2022
Letters animation allows you to click on different letters and accordingly it will animate letters in a cool way. It has a very attractive UI and is very easy to use.

Letters Animation Cool Letters Animation in iOS written in Swift. Preview Table of content :- Description How to add in your project Requirement Licen

MindInventory 31 Oct 4, 2022
Numbers animation allows you to click on different numbers and accordingly it will animate numbers in a cool way. It has a very attractive UI and is very easy to use.

Numbers Animation Cool Numbers Animation in iOS written in Swift. Preview Table of content :- Description How to add in your project Requirement Licen

MindInventory 31 Oct 4, 2022
Reading animation allows you to click on the different page numbers and accordingly it will animate page changes in a cool way. It has a very attractive UI and is very easy to use.

Reading Animation Cool Reading Animation in iOS written in Swift. Preview Table of content :- Description How to add in your project Requirement Licen

MindInventory 42 Oct 4, 2022