UIAlertController with continuity.

Overview

CuckooAlert

Allow multiple use of presentViewController to UIAlertController.

Swift Version Build Status Carthage compatible CocoaPods Compatible
Platform

You may be disappointed from this. Do you imagine that cuckoo spit out some alerts with beatiful animation?

Sorry.

Umm, May be later. But, not now.

This is some codes with swizzle for make UIAlertController multiple using of presentViewController.

Requirements

  • iOS 8.4+
  • Xcode 7.3

Installation

CocoaPods

You can use CocoaPods to install CuckooAlert by adding it to your Podfile:

platform :ios, '8.4'
use_frameworks!
pod 'CuckooAlert'

To get the full benefits import CuckooAlert wherever you import UIKit

import UIKit
import CuckooAlert

Carthage

Create a Cartfile that lists the framework and run carthage update. Follow the instructions to add $(SRCROOT)/Carthage/Build/iOS/CuckooAlert.framework to an iOS project.

github "singcodes/CuckooAlert"

Manually

  1. Download and drop CuckooAlert.swift in your project.
  2. Congratulations!

Usage example

Swift

import CuckooAlert

in AppDeleaget launching

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
        CuckooAlert.registCuckooAlert()
        return true
}

in ViewController

        var alert = UIAlertController(title: "title", message: "message", preferredStyle: .Alert)
        let cancel = UIAlertAction(title: "Cancel", style: .Cancel, handler: nil)
        alert.addAction(cancel)
        // present first alert controller
        self.presentViewController(alert, animated: true, completion: nil)
        
        alert = UIAlertController(title: "title2", message: "message2", preferredStyle: .Alert)
        alert.addAction(cancel)
        // present second alert controller
        self.presentViewController(alert, animated: true, completion: nil)
        
        if let vc = self.storyboard?.instantiateViewControllerWithIdentifier("2") {
            // This will be ignored with some Warning:
            self.presentViewController(vc, animated: true, completion: nil)
        }
        
        alert = UIAlertController(title: "title3", message: "message3", preferredStyle: .Alert)
        alert.addAction(cancel)
        // present third alert controller
        self.presentViewController(alert, animated: true, completion: nil)

ObjC

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    [CuckooAlert registCuckooAlert];
    return YES;
}

in ViewController

    UIAlertAction *cancel = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:nil];
    UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"title" message:@"message" preferredStyle:UIAlertControllerStyleAlert];
    [alert addAction:cancel];
    // present first alert controller
    [alert showWithParentViewController:self animated:true completion:nil];
    alert = [UIAlertController alertControllerWithTitle:@"title2" message:@"message2" preferredStyle:UIAlertControllerStyleAlert];
    [alert addAction:cancel];
    // present second alert controller
    [alert showWithParentViewController:self animated:true completion:nil];
    
    // This will be ignored with some Warning:
    [self presentViewController:[self.storyboard instantiateViewControllerWithIdentifier:@"2"] animated:YES completion:nil];
    
    alert = [UIAlertController alertControllerWithTitle:@"title3" message:@"message3" preferredStyle:UIAlertControllerStyleAlert];
    [alert addAction:cancel];
    [alert showWithParentViewController:self animated:true completion:nil];

seeing Example, ExampleObjc targets on CuckooAlert projects

Release History

  • 1.1.0

    • apply swift 3
    • minimum iOS version to 9.0 from 8.4
  • 1.0.1

    • add prompt function to UIViewController
    • removing some debugging print
  • 1.0.0

    • add CuckooAlert.swift
    • add CuckooAlert class for enabling swizzles
    • swizzling function of viewDidLoad, viewDidDisappear, presentViewController on UIViewController for management of UIAlertController present queue
    • add some handy function to UIAlertController

Contribute

I would love for you to contribute or modifying or copy and anything to CuckooAlert, check the LICENSE file for more info.

Meta

singcodes – @KwanghoonChoi[email protected]

Distributed under the BSD(3-clause) license. See LICENSE for more information.

https://github.com/singcodes

You might also like...
This is an iOS control for presenting any UIView in an UIAlertController like manner
This is an iOS control for presenting any UIView in an UIAlertController like manner

RMActionController This framework allows you to present just any view as an action sheet. In addition, it allows you to add actions around the present

This is an iOS control for selecting something using UIPickerView in an UIAlertController like manner
This is an iOS control for selecting something using UIPickerView in an UIAlertController like manner

RMPickerViewController This framework allows you to pick something with a picker presented as an action sheet. In addition, it allows you to add actio

Simple Alert View written in Swift, which can be used as a UIAlertController. (AlertController/AlertView/ActionSheet)
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

An easy to use UIAlertController builder for swift

LKAlertController An easy to use UIAlertController builder for swift Features Short and simple syntax for creating both Alerts and ActionSheets from U

Customizable replacement for UIAlertController

ActionSheet Customizable replacement for UIAlertController. Requirements Installation Swift Package Manager The Swift Package Manager is a tool for au

Use UIAlertController like a boss.
Use UIAlertController like a boss.

Description Requirements Installation CocoaPods Carthage Usage License Description CatAlertController is a high level manager object that with chainin

A simple custom popup dialog view for iOS written in Swift. Replaces UIAlertController alert style.
A simple custom popup dialog view for iOS written in Swift. Replaces UIAlertController alert style.

A simple custom popup dialog view for iOS written in Swift. Replaces UIAlertController alert style.

UIPicker inside a UIAlertController
UIPicker inside a UIAlertController

DPPickerManager UIPicker inside a UIAlertController HOW TO USE : // Strings Picker let values = ["Value 1", "Value 2", "Value 3", "Value 4"] DPPickerM

An easier constructor for UIAlertController. Present an alert from anywhere.
An easier constructor for UIAlertController. Present an alert from anywhere.

ALRT An easier constructor for UIAlertController. Present an alert from anywhere like this. ALRT.create(.alert, title: "Alert?").addOK().addCancel().s

Owner
Jay Choi
YES, iOS
Jay Choi
Advanced usage of UIAlertController and pickers based on it: Telegram, Contacts, Location, PhotoLibrary, Country, Phone Code, Currency, Date...

Alerts & Pickers Advanced usage of native UIAlertController with TextField, TextView, DatePicker, PickerView, TableView, CollectionView and MapView. F

RV 5.5k Dec 22, 2022
An easier constructor for UIAlertController. Present an alert from anywhere.

ALRT An easier constructor for UIAlertController. Present an alert from anywhere like this. ALRT.create(.alert, title: "Alert?").addOK().addCancel().s

Masahiro Watanabe 97 Nov 11, 2022
Easy Swift UIAlertController

EZAlertController Easy Swift UIAlertController One line setup for all UIAlertControllers Button action with closures instead of selectors Easily custo

Kan Yilmaz 366 Sep 14, 2022
Simple UIAlertController builder class in Swift.

Kamagari Simple UIAlertController builder class in Swift. Features AlertBuilder class to simply build UIAlertController by using method chaining UIAle

Kazunobu Tasaka 78 Nov 29, 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
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
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
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
Advanced usage of UIAlertController and pickers based on it: Telegram, Contacts, Location, PhotoLibrary, Country, Phone Code, Currency, Date...

Alerts & Pickers Advanced usage of native UIAlertController with TextField, TextView, DatePicker, PickerView, TableView, CollectionView and MapView. F

RV 5.5k Dec 26, 2022
This is an iOS control for selecting a date using UIDatePicker in an UIAlertController like manner

RMDateSelectionViewController This framework allows you to select a date by presenting an action sheet. In addition, it allows you to add actions arro

Roland Moers 1.2k Dec 13, 2022