FCAlertView is a Flat Customizable AlertView for iOS (Written in Objective C)

Overview

FCAlertView

FCAlertView is a Flat Customizable AlertView, written in Objective C

Version License Platform

Logo

BackgroundImage BackgroundImage BackgroundImage BackgroundImage BackgroundImage BackgroundImage

Quick Links

1. Swift
2. Installation
3. Example App
4. Adding FCAlertView
5. Base Customizations
6. Extra Customizations
7. New Customizations (after V1.1.0)
8. Animations
9. Adding TextFields
10. Button Actions
11. Other Helper Methods

Swift

For the swift version of FCAlertView, Click Here. Credits to Kris Penney for writing the swift library.

Installation

Using CocoaPods

FCAlertView is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'FCAlertView'

Manually

Clone or Download this Repo. Then simply drag the folder FCAlertView to your Xcode project. Please make sure to drag the whole folder, which includes assets needed for some alert types.

Example

FCAlertView comes with an example app that you can use to try out all of the customizations below. It's recommended that you go through all of the docs before using the example app. To use the example app, clone or download FCAlertView, open and run Example/FCAlertView.xcworkspace.

Adding FCAlertView

Start by adding the following to your desired View Controller:

#import "FCAlertView.h"

Presenting an FCAlertView

FCAlertView *alert = [[FCAlertView alloc] init];
	
[alert showAlertInView:self
             withTitle:@"Alert Title"
          withSubtitle:@"This is your alert's subtitle. Keep it short and concise. 😜👌"
       withCustomImage:nil
   withDoneButtonTitle:nil
            andButtons:nil];

Showing Options

You can also present your FCAlertView using the following:

By Selecting a specific UIWindow

[alert showAlertInWidnow:self.view.window
             withTitle:@"Alert Title"
          withSubtitle:@"This is your alert's subtitle. Keep it short and concise. 😜👌"
       withCustomImage:nil
   withDoneButtonTitle:nil
            andButtons:nil];

Using UIApplication Window

This method will also bring your alert to the front so that keyboard or any other element don't cover it.

[alert showAlertWithTitle:@"Alert Title"
          withSubtitle:@"This is your alert's subtitle. Keep it short and concise. 😜👌"
       withCustomImage:nil
   withDoneButtonTitle:nil
            andButtons:nil];

Base Customizations

  • Title (NSString): You can leave the Title as nil or Give it an NSString.

  • Subtitle (NSString): FCAlertView always requires a subtitle, even if you want just a few words, add it here instead of the title (then leave the title as nil). Take a look at this screenshot for an example.

  • CustomImage (UIImage): You can leave this image as nil or Give it a UIImage which will show at the top of the alert. Take a look at this screenshot for an example for an example.

  • DoneButtonTitle (NSString): You can leave this as nil to show "Ok" as the dismiss button for the AlertView, or Give it an NSString.

  • Buttons (NSArray of NSStrings): If you want to add buttons to your alert, simply add an array of 1 or 2 button titles as NSString here, anything more will be ignored as 2 is the max custom buttons you can add (aside from the done button). Read more about buttons and actions further down.

Adding Buttons With Action Blocks

Alternatively, you can add buttons to FCAlertView with action block like so:

[alert addButton:@"Button" withActionBlock:^{
    // Put your action here
}];

Action Block for Done Button

[alert doneActionBlock:^{ 
    // Put your action here
}];

Extra Customizations

This section includes all the tiny details that you can customize your alert with, which makes FCAlertView very customizable. Or leave it as is and enjoy the simplicity.

Color Scheme

By default, FCAlertView doesn't include a color scheme, much like UIAlertView, but you can add one by adding this line:

alert.colorScheme = [UIColor colorWithRed:150.0f/255.0f green:150.0f/255.0f blue:150.0f/255.0f alpha:1.0];

If you add a custom image to your alert, it will be tinted with the color scheme by default. To keep this from happening, add this:

alert.avoidCustomImageTint = YES; // Off by default

FCAlertView also comes with a set of pre-made colors that you can use:

alt text

Credit goes to flatuicolors.com for the Beautiful Palette of Flat Colors

Simply choose the color you'd like to use for your AlertView, and add:

alert.colorScheme = alert.flatBlue; // Replace "Blue" with your preferred color from the image above

Dark Mode

Use this line to apply a beautiful dark theme to your FCAlert:

alert.darkTheme = YES;

Title and Subtitle Styling

Change Title Color by Adding

alert.titleColor = alertView.flatPurple;

Change SubTitle Color by Adding

alert.subTitleColor = alertView.flatBlue;

Change Title Font by Adding

alert.titleFont = [UIFont fontWithName:@"Avenir" size:30.0];

Change SubTitle Font by Adding

alert.subtitleFont = [UIFont fontWithName:@"Avenir" size:15.0];

You can also use Attributed text in the title or the subtitle!

NSString *text = @"My Alert Title";

NSDictionary *attrib = @{
                         NSForegroundColorAttributeName: [UIColor blackColor],
                         NSFontAttributeName: [UIFont systemFontOfSize:18.0 weight:UIFontWeightRegular]
                         };
NSMutableAttributedString *str = [[NSMutableAttributedString alloc] initWithString:text attributes:attrib];

NSRange nameRange = [text rangeOfString:@"Title"];
UIFont *italics = [UIFont systemFontOfSize:18.0 weight:UIFontWeightHeavy];
[str setAttributes:@{NSFontAttributeName:italics} range:nameRange];
// Use the string as a title!
[alert showAlertWithAttributedTitle:str withSubtitle:@"This is my subtitle!" withCustomImage:_alertImage withDoneButtonTitle:nil andButtons:self.arrayOfButtonTitles];
// Or use it as a subtitle!
[alert showAlertWithTitle:@"My Title" withAttributedSubtitle:str withCustomImage:_alertImage withDoneButtonTitle:nil andButtons:self.arrayOfButtonTitles];
// Or use it as both!
[alert showAlertWithAttributedTitle:str withAttributedSubtitle:str withCustomImage:_alertImage withDoneButtonTitle:nil andButtons:self.arrayOfButtonTitles];

Button Styling

Change Title Color of Buttons

alert.firstButtonTitleColor = [UIColor blueColor];
alert.secondButtonTitleColor = [UIColor blueColor];

Change Background Color of Buttons

alert.firstButtonBackgroundColor = [UIColor whiteColor];
alert.secondButtonBackgroundColor = [UIColor blackColor];

Add Button Background Color for Highlight

alert.firstButtonHighlightedBackgroundColor = [UIColor whiteColor];
alert.firstButtonHighlightedBackgroundColor = [UIColor blackColor];

Customize Button Fonts

alert.doneButtonCustomFont = [UIFont fontWithName:@"Avenir" size:15.0];
alert.firstButtonCustomFont = [UIFont fontWithName:@"Avenir" size:15.0];
alert.secondButtonCustomFont = [UIFont fontWithName:@"Avenir" size:15.0];

Rounded Corners

Change the Rounding of the FCAlertView's corners as desired using:

alert.cornerRadius = 4; // Replace 4 with your desired corner radius amount (Set to 0.1 if you don't want rounding)

Alert Types

FCAlertView comes with 6 pre-designed alert types: Success, Caution, Warning, Progress, Rating with Hearts, or Rating with Stars, simply add the one line after initializing FCAlertView.

Success

[alert makeAlertTypeSuccess];

Caution

[alert makeAlertTypeCaution];

Warning

[alert makeAlertTypeWarning];

Progress

[alert makeAlertTypeProgress];

Rating with Hearts

Turns your alert into a rating alert to allow users to rate using hearts.

[alert makeAlertTypeRateHearts:^(NSInteger rating) {
    NSLog(@"Your Hearts Rating: %ld", (long)rating); // Use the Rating as you'd like
}];

Rating with Stars

Turns your alert into a rating alert to allow users to rate using stars.

[alert makeAlertTypeRateStars:^(NSInteger rating) {
    NSLog(@"Your Stars Rating: %ld", (long)rating); // Use the Rating as you'd like
}];

Dismissing FCAlertView

There are multiple ways you can dismiss an FCAlertView

Close on Outside Touch

When the user taps anywhere outside the alert, you can dismiss it by adding this line:

alert.dismissOnOutsideTouch = YES;

Auto-Close the Alert

Dismiss the AlertView when a certain time has elapsed after the AlertView is presented, by adding this line:

alert.autoHideSeconds = 5; // Replace 5 with the number of Seconds you'd like the view to appear for before dismissing itself

Done Button or Any Custom Buttons

All Buttons including the Done/Dismiss Button will make the FCAlertView dismiss.

Dismissing it yourself

If you'd like to dismiss the AlertView yourself, simply add the following line to where you need it:

[alert dismissAlertView];

Hiding Done/Dismiss Button

If you'd like to have no buttons on your AlertView (to simply display a notification or approval of something) or you want all your buttons to be a custom one which you've added yourself. Simply hide the Done buttons by adding this line:

alert.hideDoneButton = YES;

Hiding All Buttons

If you'd like to simply hide all buttons from your alert, you can do so by adding this line:

alert.hideAllButtons = YES;

Please note that hiding Done/Dismiss Button and/or Hiding All Buttons would trigger a safety close mechanism by forcing Close on Outside Touch to stay ON.

New Customizations (after V1.1.0)

Blur Background

Simply adds a blur to the background of the window/view behind the alertview:

alert.blurBackground = YES;

Round Buttons

If you prefer the buttons to be detached from the box of the alert and look more round, use:

alert.detachButtons = YES;

Full Circle Custom Image

If you prefer the custom image for you alert to be full width of the image circle, use:

alert.fullCircleCustomImage = YES;

Custom Image Scaling

If you prefer the custom image for you alert to be scaled up or down to a certain size, use:

alert.customImageScale = 1.5; // Change 1.5 to how big or small you want to scale your custom alert image ranged from 0 to 2

Hiding Separator Lines

To hide the separator lines that appear between the done and custom buttons of the alert, add:

alert.hideSeparatorLineView = YES;

Sounds

Add the following line to play an audio when the alert opens, simply pass it the name of your audiofile:

[alert setAlertSoundWithFileName:@"Ding.mp3"];

Note: Add these Frameworks to your project for this to work: AVFoundation and AudioToolbox.

Animations

Bounce/Natural Animations

Adds more natural animations to the alertview, such as reactive bounce buttons and more. Add this line:

alert.bounceAnimations = YES;

Animating Alert Into View

Have the alert animate in from different directions when presented, instead of the default appear animation.

alert.animateAlertInFromTop = YES; // Change "Top" to "Bottom", "Left", or "Right" as you desire

Animating Alert Out of View

Have the alert animate out to different directions when dismissed, instead of the default disappear animation.

alert.animateAlertOutToTop = YES; // Change "Top" to "Bottom", "Left", or "Right" as you desire

Adding TextFields

Simply add textfields (up to a max of 4 fields) to your alert, by adding this line for each new field and get the returned text when any of the AlertView's buttons are pressed:

[alert addTextFieldWithPlaceholder:@"Email Address" andTextReturnBlock:^(NSString *text) {
    NSLog(@"The Email Address is: %@", text); // Do what you'd like with the text returned from the field
}];

Customized Textfields

If you'd like to change the textfield properties and make them custom. Simply use this to add your textfield rather than the method above.

UITextField *customField = [[UITextField alloc] init];
customField.autocapitalizationType = UITextAutocapitalizationTypeAllCharacters;
        
[alert addTextFieldWithCustomTextField:customField andPlaceholder:@"Placeholder" andTextReturnBlock:^(NSString *text) {
     NSLog(@"Custom TextField Returns: %@", text); // Do what you'd like with the text returned from the field
}];

Button Actions

To add methods for detecting actions on your buttons, do the following:

First add FCAlertViewDelegate to your View Controller's @interface as such:

#import <UIKit/UIKit.h>
#import "FCAlertView.h"

@interface ViewController : UIViewController <FCAlertViewDelegate>

@end

Now add your FCAlertView with Buttons where you need to present it:

	FCAlertView *alert = [[FCAlertView alloc] init];
	
	alert.delegate = self;

    [alert showAlertInView:self
                 withTitle:@"Alert Title"
              withSubtitle:@"This is your alert's subtitle. Keep it short and concise. 😜👌"
           withCustomImage:nil
       withDoneButtonTitle:nil
                andButtons:@[@"Button 1", @"Button 2"]]; // Set your button titles here

After adding your FCAlertView, you can detect button touches by adding this method to your class:

- (void) FCAlertView:(FCAlertView *)alertView clickedButtonIndex:(NSInteger)index buttonTitle:(NSString *)title {
    if ([title isEqualToString:@"Button 1"]) { // Change "Button 1" to the title of your first button
        // Perform Action for Button 1
    }
    
    if ([title isEqualToString:@"Button 2"]) {
        // Perform Action for Button 2
    }
}

Done Button Method

If you'd also like to detect button touch for the Done/Dismiss button, simply add this method to your class:

- (void)FCAlertDoneButtonClicked:(FCAlertView *)alertView {
	// Done Button was Pressed, Perform the Action you'd like here.
}

Other Helper Methods

Make sure to add FCAlertViewDelegate to your View Controller's @interface as such:

#import <UIKit/UIKit.h>
#import "FCAlertView.h"

@interface ViewController : UIViewController <FCAlertViewDelegate>

@end

and setting the delegate of your FCAlertView, as such:

  FCAlertView *alert = [[FCAlertView alloc] init];
  alert.delegate = self;

Detect when FCAlertView has been dismissed

- (void)FCAlertViewDismissed:(FCAlertView *)alertView {
	// Your FCAlertView was Dismissed, Perform the Action you'd like here.
}

Detect when FCAlertView is about to present

- (void)FCAlertViewWillAppear:(FCAlertView *)alertView {	
	// Your FCAlertView will be Presented, Perform the Action you'd like here.
}

Future Customizations

FCAlertView is an ongoing project with the goal of becoming the most used custom AlertView for iOS. Improvements and changes are on the way, and here are some of the things that are coming soon with it:

  • Swift Friendly ✓
  • Adding TextFields ✓
  • Blur Background ✓
  • Frame Customizations ✓
  • Alert Sounds ✓
  • Landscape Orientation ✓
  • More Custom Animations ✓
  • More Types of Alerts (including Progress Types) ✓
  • iPad Friendly Alerts (tested on all devices) ✓
  • Improved Button Highlighting and Customizations ✓
  • Something Missing? Create a pull request or issue with your suggestion.

About FCAlertView

FCAlertView is a fully customizable and beautifully designed AlertView. I designed FCAlertView because I've always wanted to have access to change the different attributes of the default UIAlertView. In terms of design, FCAlertView looks similar to the default AlertView, however, as you start customizing it for your specific need, you realize it can do a lot more while looking flat and sharp.

FCAlertView lets you do things such as specify the number of buttons, the color scheme of the view, adding a small image to it, hide the view after a certain time, and more. A full description of how to customize FCAlertView to fit your alert can be found on http://github.com/nimati/FCAlertView.

The Vision for FC Libraries

My goal is to create a set of different libraries, each targetting a certain UI element of iOS, with the goal to improve the design and add more customizations. As such, FCAlertView is a more Flat/Customizable AlertView. With this mindset, I'd like to create more FC libraries, such as FCActionSheet, FCNotification (for quick, in app alerts), FCPopoverView, FCGuideView (for guiding your users around your app). If you also have a suggestion for an FC Library, please open an issue and tell me about it.

Ultimately, FCLibraries is here to improve the look and feel of your app for your end users. So all improvements and suggestions are welcome.

Cheers 🍻

Author

Created and designed by Nima Tahami.

Credits for the Beautiful Color Palette goes to flatuicolors.com.

Credit for the Beautiful Icons go to ionicons.com.

License

FCAlertView is available under the MIT license. See the LICENSE file for more info.

Comments
  • Doesn't go on top of keyboard

    Doesn't go on top of keyboard

    In my use case, the FCAlertView does not go on top of the keyboard. I have a similar component that shows a progress circle that is used in exactly the same circumstance, but that goes on top of the keyboard. This is causing issues because whilst the AlertView is operating, the user can still type stuff in keyboard.

    I looked at code:

    Your code:

    - (void) showAlertInView:(UIViewController *)view withTitle:(NSString *)title withSubtitle:(NSString *)subTitle withCustomImage:(UIImage *)image withDoneButtonTitle:(NSString *)done andButtons:(NSArray *)buttons {
    
        [self checkCustomizationValid];
        [self safetyCloseCheck];
    
        [view.view.window addSubview:self];
    
    }
    

    I looked at other component's code: https://github.com/AssistoLab/KVNProgress/blob/master/KVNProgress/Classes/KVNProgress.m#L870

    - (void)addToWindow
    {
        self.originalKeyWindow = [UIApplication sharedApplication].keyWindow;
    
        if (!self.progressWindow) {
            self.progressWindow = [[UIWindow alloc] initWithFrame:self.originalKeyWindow.frame];
    
            // That code makes the custom UIWindow handle the orientation changes.
            // http://stackoverflow.com/a/27091111/2571566
            self.progressWindow.rootViewController = [[KVNRotationViewController alloc] init];
        }
    
        self.progressWindow.frame = self.originalKeyWindow.frame;
    
        // Since iOS 9.0 set the windowsLevel to UIWindowLevelStatusBar is not working anymore.
        // This trick, place the progressWindow on the top.
        UIWindow *lastWindow = [[[UIApplication sharedApplication] windows] lastObject];
        self.progressWindow.windowLevel = lastWindow.windowLevel + 1;
    
        [self.progressWindow makeKeyAndVisible];
        [self addToView:self.progressWindow];
    }
    

    KVNProgress gives us the option to select the view we want the component to be on top of. If we don't select a view, it uses the code above to correctly place the component on top of everything - including the keyboard.

    This is the approach to take. Can you please make another method that allows us to provide the view instead of us providing the viewcontroller.

    opened by pjebs 18
  • Blurry Background

    Blurry Background

    It would be nice if you can add blurry background using https://github.com/ivoleko/ILTranslucentView for iOS 7 and UIVisualEffectView for iOS 8+.

    The ILTranslucentView repo has objc and swift code. Unfortunately you won't be add it as a cocoapod dependency since ios7+swift+cocoapods doesn't mix and the guy put the objc files and swift files in same folder so cocoapods gets confused if you try and use only the obj files: https://github.com/ivoleko/ILTranslucentView/issues/20

    @https://github.com/nimati/FCAlertView/blob/master/FCAlertView/Classes/FCAlertView.m#L36:

    You can do an objective-C version of below code. (I use swift for my project)

            if #available(iOS 8.0, *) {
                // Use UIVisualEffectView
                let tvev = UIVisualEffectView(effect:  UIBlurEffect(style: .Dark))
                tvev.translatesAutoresizingMaskIntoConstraints = false
                _alertBackground.addSubview(tvev)
            } else {
                //For iOS 7 - Use ILTranslucentView
                (self.viewExternal as! ILTranslucentView).translucentAlpha = 1
                (self.viewExternal as! ILTranslucentView).translucentStyle = .Black
                (self.viewExternal as! ILTranslucentView).translucentTintColor = UIColor.clearColor()
                self.viewExternal.backgroundColor = UIColor.clearColor()
            }
    
    opened by pjebs 10
  • Add support for custom font and attributed text.

    Add support for custom font and attributed text.

    These changes add support for custom fonts for the title and subtitle, as well as attributed text in the title and subtitle. If attributed text is specified, the fonts will be ignored.

    Examples have been updated for both cases as well.

    opened by digitalcatnip 9
  • Wrong popup height when using attributed subtitle string

    Wrong popup height when using attributed subtitle string

    Hi, there is a bug in calculation of popup height when using attributed string as a subtitle, see scrennshots.

    popup attrstring

    Atributes used:

    `

    NSMutableParagraphStyle *attributedStringParagraphStyleTitle = [[NSParagraphStyle defaultParagraphStyle]mutableCopy];
    attributedStringParagraphStyleTitle.alignment = NSTextAlignmentCenter;
    attributedStringParagraphStyleTitle.paragraphSpacing = 6.0;
    
    NSMutableParagraphStyle *attributedStringParagraphStyleSubtitle = [[NSParagraphStyle defaultParagraphStyle]mutableCopy];
    attributedStringParagraphStyleSubtitle.alignment = NSTextAlignmentCenter;
    attributedStringParagraphStyleSubtitle.paragraphSpacing = 12.0;
    
    NSMutableParagraphStyle *attributedStringParagraphStyle = [[NSParagraphStyle defaultParagraphStyle]mutableCopy];
    attributedStringParagraphStyle.alignment = NSTextAlignmentCenter;
    attributedStringParagraphStyleSubtitle.paragraphSpacing = 3.0;
    
    NSString *strKey  = annotation.featurePoint.featureKey;
    NSDictionary *attrKey = @{ NSForegroundColorAttributeName:ansColorBlueLagoon,
                               NSParagraphStyleAttributeName:attributedStringParagraphStyleTitle,
                               NSFontAttributeName:[UIFont fontWithName:@"Futura-Bold" size:18.0] };    // [UIFont boldSystemFontOfSize:18.0f]
    
    NSString *strName = annotation.featurePoint.featureName;
    NSDictionary *attrName = @{ NSForegroundColorAttributeName:ansColorSapphire,
                                NSParagraphStyleAttributeName:attributedStringParagraphStyleSubtitle,
                                NSFontAttributeName:[UIFont fontWithName:@"Futura-Bold" size:16.0] };    // [UIFont boldSystemFontOfSize:18.0f]
    
    NSString *strFir  = annotation.featurePoint.featureFIR";
    NSDictionary *attrFir  = @{ NSForegroundColorAttributeName:ansColorSapphire,
                                NSParagraphStyleAttributeName:attributedStringParagraphStyle,
                                NSFontAttributeName:[UIFont fontWithName:@"Futura-Bold" size:16.0] };    // [UIFont boldSystemFontOfSize:18.0f]
    
    NSString *strCoordinate = annotation.featurePoint.featureCoordinate;
    NSDictionary *attrCoordinate = @{ NSForegroundColorAttributeName:ansColorCelurean,
                                      NSParagraphStyleAttributeName:attributedStringParagraphStyle,
                                      NSFontAttributeName:[UIFont fontWithName:@"Futura-Bold" size:14.0] };    // [UIFont boldSystemFontOfSize:18.0f]
    
    NSAttributedString *attribText = [NSAttributedString rz_attributedStringWithStringsAndAttributes:
                                      [NSString stringWithFormat:@"%@\n",strKey],attrKey,
                                      [NSString stringWithFormat:@"%@\n",strName],attrName,
                                      [NSString stringWithFormat:@"FIR: %@\n",strFir],attrFir,
                                      [NSString stringWithFormat:@"Lat/Lon: %@",strCoordinate],attrCoordinate,
                                      nil];
    

    `

    opened by tvlc 5
  • Not showing on  beta versions.

    Not showing on beta versions.

    I tried to use this controller in beta devices and my experiences were very bad. Most of the time alert not showing in beta iOS versions some times it may not work in iOS 10.3 and later versions.

    opened by irshadpc 5
  • FCAlertView close on touch outside when should not.

    FCAlertView close on touch outside when should not.

    Hi, this is my code but first a short explanation: The alert view dismiss on outside touch no matter if I setting "NO" and I need the alert view to dismiss just when the background task have done! I guess this is a mistake in the alertView because the alert view dismiss when should not. Sorry for the english, I hope you can fix it, thank you and have a nice day.

    [alert setDismissOnOutsideTouch:NO]; [alert showAlertWithTitle:@"Sending, please wait..." withSubtitle:nil withCustomImage:nil withDoneButtonTitle:nil andButtons:nil]; dispatch_queue_t queue = dispatch_queue_create("My queue", NULL); dispatch_async(queue, ^{ //code to be executed in the background NSLog(@"Inside background task"); [self sendDataToServer:@"POST"]; dispatch_async(dispatch_get_main_queue(), ^{ //code to be executed on the main thread when background task is finished NSLog(@"task done"); [alert dismissAlertView]; });

    opened by andres9394 5
  • Delegate not working in Swift

    Delegate not working in Swift

    For some reason, it seems that the FCAlertViewDelegate causes issues in Swift. Although FCAlertView class is imported and recognized, as soon as I try implementing the delegate (or inherit from it) Swift reports that the class FCAlertView is not defined anymore, which makes little sense because FCAlertViewDelegate (which is part of the same class) is properly recognized.

    captura de pantalla 2016-12-10 a las 15 24 22

    I do have FCAlertView.h in my bridging header file, so that's not the issue, and sadly I cannot use the Swift version of this pod because we are still stuck with Swift 2.2 and our guidelines forbid the use of libraries which are not part of CocoaPods

    opened by mradzinski 5
  • Fixed width

    Fixed width

    now FCAlertView has fixed margin and fixed height
    defaultSpacing = 105.0f; defaultHeight = 200.0f; i want to fix the width and height , can you provide two properties ?

    opened by guanzhendong 5
  • UI Freeze after SFSafariServices dismisses

    UI Freeze after SFSafariServices dismisses

    Hi, I may have found a pretty nasty bug.

    How to reproduce: 1- Present a SFSafariServices with any URL 2- Dismiss de SFSafariServices modal by clicking "Done" 3- Hit a button that displays an alert

    Expected result: The alert should appear on screen

    Current result: The screen freezes and only accepts taps again after rotating the device to another orientation.

    opened by ripventura 3
  • Title on two lines

    Title on two lines

    Hi,

    This is a proposal to improve this succulent framework!

    It would be nice that we can have a title on two lines when it's needed. In my natural language, some words are long, and on iPhone, it's very fast to have something like:

    "Réinitialiser votre code..."

    Instead of:

    "Réinitialiser votre code PIN"

    Thank you!

    opened by ipefixe 3
  • Alert not showing

    Alert not showing

    I am using the latest pod version of FCAlertView

    The alert view is not showing for me, the first few times.

    This is the code I use to show the FCAlertView (Method 1): let alert = FCAlertView() alert.makeAlertTypeWarning() alert.blurBackground = true alert.showAlert(withTitle: nil, withSubtitle: withText.localized, withCustomImage: nil, withDoneButtonTitle: nil, andButtons: nil)

    Or this way (Method 2):

    let alert = FCAlertView() alert.colorScheme = "#8DCA63".hexColor alert.blurBackground = true alert.dismissOnOutsideTouch = true alert.avoidCustomImageTint = true alert.delegate = self alert.showAlert(withTitle: nil, withSubtitle: "String", withCustomImage: UIImage(named: "image") , withDoneButtonTitle: "String", andButtons: ["String"])

    But it only shows when I call it the way I showed above in a certain view controller.

    Let's say we have VC1, VC2 and VC3

    I call the Method 2 in VC1 and it doesn't show an alert, then I call the Method 1 in VC2 and it doesn't show an alert, then in VC3 I call Method 2 and it shows an alert. After it shows up the first time it shows up on every VC.

    Maybe I am doing something stupid or wrong, but I've tried everything and I can't get it to work...

    I hope someone haves a solution

    opened by Mar-k 3
  • TextField being covered by inputAccessoryView

    TextField being covered by inputAccessoryView

    Hi, when a textfield is added to the alert view and it becomes the first responder, the keyboard appears. When moving alert view up, you're not taking into consideration if the textfield has an inputAccessoryView. You should move the alert view adding also the height of this view.

    Davide

    bug enhancement 
    opened by CivicFan 1
  • Fix text fields

    Fix text fields

    Fixed a bug showing only one text field when adding more then one with

    [alert addTextFieldWithPlaceholder:@"Email Address" andTextReturnBlock:^(NSString *text) {
        NSLog(@"The Email Address is: %@", text); // Do what you'd like with the text returned from the field
    }];
    
    opened by elisaBarindelli 0
  • Rotation size and origin

    Rotation size and origin

    I have a problem rotating my device with an alert added to the window. The alert is no longer centered and the background view is no longer the right size. Same with keyboard opened when having a textField.

    enhancement help wanted 
    opened by Bejil 8
Releases(1.4.2)
  • 1.4.2(Apr 16, 2020)

  • 1.4.0(Aug 7, 2017)

    This release features a bunch of new additions and fixes that have been requested, including:

    • Multiple Textfields
    • Customizable Textfields
    • Button Highlight Color Setting
    • Custom Button Fonts
    • Small fixes

    More updates are on the way! Thanks for using FCAlertView 👍 😄

    Source code(tar.gz)
    Source code(zip)
  • 1.3.1(Feb 13, 2017)

  • 1.3(Feb 13, 2017)

  • 1.2.9(Jan 6, 2017)

    This release includes a few fixes and a new feature to set a custom background color for the entire alert. Thank for using FCAlertView! Cheers 👍

    Source code(tar.gz)
    Source code(zip)
  • 1.2.8(Dec 10, 2016)

    This version includes a simple update to re-adjust the frames for the description label instead of bounding it by number of lines, allowing you to input as much text as desired.

    Source code(tar.gz)
    Source code(zip)
  • 1.2.7(Nov 13, 2016)

  • 1.2.6(Nov 13, 2016)

  • 1.2.5(Nov 7, 2016)

  • 1.2.4(Nov 5, 2016)

  • 1.2.3(Oct 31, 2016)

  • 1.2.2(Oct 30, 2016)

  • 1.2.1(Oct 30, 2016)

  • 1.2.0(Oct 30, 2016)

    Hey again,

    There are a lot of new updates with this release 😀, which covers most of the customizations I (and other users) wanted to add to FCAlertView, I hope you enjoy them!

    • Improved frames of alert to match your subtitle in a better way
    • Added 3 new alert types:
      • Progress (to show a loading alert),
      • Rating with Hearts (turn your alert into a rating system with hearts),
      • Rating with Stars
    • Added new animations for the alert opening and closing
    • Added support for landscape apps
    • Fully compatible with iPad
    • A new dark theme!
    • A new design for buttons (detachedButtons) and more customizable buttons overall
    • Other small fixes and cleanups. Thanks to everyone who contributed!

    With that said, my focus after this release will be a new library to help guide users around your app, called FCGuideView. I will of course continue improving FCAlertView and bring more suggestions to use.

    Cheers, Nima

    Source code(tar.gz)
    Source code(zip)
  • 1.1.2(Oct 15, 2016)

  • 1.1.0(Oct 15, 2016)

    Hey there,

    Here are some of the features in this release:

    • More flexible framing
    • TextFields
    • Blur Effects
    • Natural/Bounce Animations
    • Sounds for Alert
    • iOS 10.0+ Tested
    • Small bug fixes and screen size fixes for all iPhone sizes

    The Example app has also been updated to showcase these new features, download the REPO and check it out when you can 👍

    Next update will be geared towards more alert types, landscape orientation, and more! Cheers!

    Source code(tar.gz)
    Source code(zip)
  • 1.0.9(Sep 12, 2016)

  • 1.0.8(Sep 12, 2016)

    • Adding views has been updated so you can specify which UIViewController, or UIWindow you'd like to present the alert in, or simply present it on the UIApplication window.
    • Additionally, issue of Keyboard appearing on top of alert has been fixed.
    • Example app bug fixes

    Future releases will fully support iPad, and landscape orientations, as iPad FCAlertView integration is in Beta at the moment.

    Cheers 👍

    Source code(tar.gz)
    Source code(zip)
  • 1.0.7(Sep 2, 2016)

  • 1.0.6(Sep 1, 2016)

  • 1.0.5(Aug 30, 2016)

  • 1.0.4(Aug 28, 2016)

    • Changed ‘Ok’ to ‘OK’ (credits to stuartjmoore) for the changes.
    • Added Safety Mechanism (credits to CarloscCheng) for pointing it out.
    • Added Action Block method for buttons (credits to pjebs) for pointing it out.
    • Restructured how buttons work in FCAlertView.
    • Fixed gap in horizontal separators.
    Source code(tar.gz)
    Source code(zip)
  • 1.0.3(Aug 26, 2016)

  • 1.0.2(Aug 26, 2016)

  • 1.0.0(Aug 26, 2016)

    First release ready for production in your apps. This release includes all the specified features on the README.md file and can be used without any issues.

    Source code(tar.gz)
    Source code(zip)
  • V1.0.1(Aug 26, 2016)

  • 0.0.23(Aug 20, 2016)

    In this release:

    • Example app is working fully and has all the customizations that you can try out before implementing it in your app. To use, go to FCAlertView/Example/FCAlertView.xcworkspace
    • Added subtitle colour customizations.
    • Some bug fixes.
    Source code(tar.gz)
    Source code(zip)
  • 0.0.22(Aug 14, 2016)

  • 0.0.21(Aug 13, 2016)

  • 0.0.20(Aug 13, 2016)

Owner
Nima Tahami
Entrepreneur & Designer. Co-Founder of ShiftRide
Nima Tahami
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
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
Cool AlertView

AMSmoothAlert • Now include multiple buttons feature you asked :) • Now available on Cocoapods : AMSmoothAlert I saw this pretty cool alert view conce

Antoine Marliac 1.3k Nov 20, 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
Beautiful animated Login Alert View. Written in Objective-C

UIAlertView - Objective-C Animated Login Alert View written in Swift but ported to Objective-C, which can be used as a UIAlertView or UIAlertControlle

Letovsky 2 Dec 22, 2021
A simple, customizable popup dialog for iOS written in Swift. Replaces UIAlertController alert style.

Introduction Popup Dialog is a simple, customizable popup dialog written in Swift. Features Easy to use API with hardly any boilerplate code Convenien

Orderella Ltd. 3.8k Dec 20, 2022
Fully customizable and extensible action sheet controller written in Swift

XLActionController By XMARTLABS. XLActionController is an extensible library to quickly create any custom action sheet controller. Examples The action

xmartlabs 3.3k Dec 31, 2022
iOS / Objective C: an extremely simple UIAlertView alternative

RKDropdownAlert an extremely simple (and customizeable) alert alternative based on Facebook's app Slingshot, and inspiration from SVProgressHUD (yes,

Richard Kim 1.5k Nov 20, 2022
The easiest way to display highly customizable in app notification banners in iOS

Written in Swift 5 NotificationBanner is an extremely customizable and lightweight library that makes the task of displaying in app notification banne

Dalton Hinterscher 4.5k Jan 9, 2023
A customizable, full-feature, lightweight iOS framework to be used instead of UIAlertController.

A customizable, full-feature, lightweight iOS framework to be used instead of UIAlertController.

Ali Samaiee 11 Jun 6, 2022
💌 Easy to use and customizable messages/notifications for iOS à la Tweetbot

Notice: TSMessages is no longer being maintained/updated. We recommend everyone migrate to RMessage. This repository will be kept as is for those who

Felix Krause 4.9k Dec 31, 2022
[iOS] Easy, customizable notifications displayed on top of the statusbar. With progress and activity. iPhone X ready.

JDStatusBarNotification Show messages on top of the status bar. Customizable colors, font and animation. Supports progress display and can show an act

M Emrich 3.8k Dec 27, 2022
Customizable Dynamic Bottom Sheet Library for iOS

DynamicBottomSheet Powerd by Witi Corp., Seoul, South Korea. Fully Customizable Dynamic Bottom Sheet Library for iOS. This library doesn't support sto

Witi Official 10 May 7, 2022
A fully customizable popup style menu for iOS 😎

Guide Check out the documentation and guides for details on how to use. (Available languages:) English 简体中文 What's a better way to know what PopMenu o

Cali Castle 1.5k Dec 30, 2022
A customizable framework to create draggable views

CFNotify CFNotify is written in Swift. Using UIKit Dynamics as animator. It can make ANY UIView object draggable and throwable. This library mainly us

Johnny Tsoi 491 Nov 20, 2022
PMAlertController is a great and customizable alert that can substitute UIAlertController

PMAlertController is a small library that allows you to substitute Apple's uncustomizable UIAlertController, with a beautiful and totally customizable

Paolo Musolino 2.5k Jan 3, 2023
PMAlertController is a great and customizable alert that can substitute UIAlertController

PMAlertController is a small library that allows you to substitute Apple's uncustomizable UIAlertController, with a beautiful and totally customizable

Paolo Musolino 2.5k Jan 3, 2023
A customizable framework to create draggable views

CFNotify CFNotify is written in Swift. Using UIKit Dynamics as animator. It can make ANY UIView object draggable and throwable. This library mainly us

Johnny Tsoi 491 Nov 20, 2022