UIViewController drop in replacement with much more customisation

Overview

PopupViewController

UIAlertController drop in replacement with much more customization

You can literally replace UIAlertController by PopupViewController and UIAlertAction by PopupAction and you're done. Does not support Action Sheet for now, just alert mode.

Simple example.

  let alert = PopupViewController(title: "Alert title", message: "Alert message, which can be very long and etc....")
  alert.addAction(PopupAction(title: "Ok", type: .positive, handler: nil))
  present(alert, animated: true, completion: nil)

Result:

Dark alert

By default it come with a dark theme, but where it become powerful is that you can customize it.

Example:

  var customizable = PopupViewController.Customizable()
  customizable.titleColor = UIColor.blue
  customizable.positiveActionColor = UIColor.red
  customizable.messageColor = UIColor.brown
  customizable.messageFont = UIFont.boldSystemFont(ofSize: 22)
  customizable.negativeActionColor = UIColor.brown
  customizable.positiveActionColor = UIColor.blue
  customizable.negativeActionBackgroundColor = UIColor.black
  customizable.positiveActionBackgroundColor = UIColor.white
  customizable.positiveActionHighlightColor = UIColor.green
  customizable.negativeActionHighlightColor = UIColor.red

  let alert = PopupViewController(title: "Alert title",
                                        message: "Alert message, which can be very long message and all that but nobody will ever read it.",
                                        customizable: customizable)
  alert.blurStyle = .extraLight
  alert.addAction(PopupAction(title: "Ok", type: .positive, handler: nil))
  alert.addAction(PopupAction(title: "Cancel", type: .negative, handler: nil))
  present(alert, animated: true, completion: nil)

Result:

Ugly alert

Yes this is very ugly. But you know...

You can also set a static Customizable, it'll be re used if you pass no customizable in the PopupViewController constructor.

  var customizable = PopupViewController.Customizable()
  customizable.titleColor = UIColor.blue
  customizable.positiveActionColor = UIColor.red
  customizable.messageColor = UIColor.brown
  customizable.messageFont = UIFont.boldSystemFont(ofSize: 22)
  customizable.negativeActionColor = UIColor.brown
  customizable.positiveActionColor = UIColor.blue
  customizable.negativeActionBackgroundColor = UIColor.black
  customizable.positiveActionBackgroundColor = UIColor.white
  customizable.positiveActionHighlightColor = UIColor.green
  customizable.negativeActionHighlightColor = UIColor.red
  PopupViewController.sharedCustomizable = alertCustomizable

Todo

  • Action Sheet support
  • UITextFields Support
  • Custom view support
  • Shared Customizable configuration
  • Remove cartography dependency
  • Easier custom transition overwrite
  • Better default transition

Installation

Normal

Add pod 'PopupViewController' in your podfile and then run pod install

Dev mode

Clone this repository and and run pod install in both the PopupViewController and Example directory.

Note

It use the amazing Cartography as a dependency for now because I'm a lazy ass and I don't want to look at the Apple doc for the ugly Autolayout code hint.

You might also like...
A replacement for as which runs in constant time instead of O(n) when the conformance is not satisfiedA replacement for as which runs in constant time instead of O(n) when the conformance is not satisfied

ZConform A replacement for as? which runs in constant time instead of O(n) when the conformance is not satisfied. How it works ZConform does a one-tim

UILabel drop-in replacement supporting Hashtags
UILabel drop-in replacement supporting Hashtags

ActiveLabel.swift UILabel drop-in replacement supporting Hashtags (#), Mentions (@), URLs (http://), Emails and custom regex patterns, written in Swif

Convert text with HTML tags, links, hashtags, mentions into NSAttributedString. Make them clickable with UILabel drop-in replacement.
Convert text with HTML tags, links, hashtags, mentions into NSAttributedString. Make them clickable with UILabel drop-in replacement.

Atributika is an easy and painless way to build NSAttributedString. It is able to detect HTML-like tags, links, phone numbers, hashtags, any regex or

Convert text with HTML tags, links, hashtags, mentions into NSAttributedString. Make them clickable with UILabel drop-in replacement.
Convert text with HTML tags, links, hashtags, mentions into NSAttributedString. Make them clickable with UILabel drop-in replacement.

Atributika is an easy and painless way to build NSAttributedString. It is able to detect HTML-like tags, links, phone numbers, hashtags, any regex or

Convert text with HTML tags, links, hashtags, mentions into NSAttributedString. Make them clickable with UILabel drop-in replacement.
Convert text with HTML tags, links, hashtags, mentions into NSAttributedString. Make them clickable with UILabel drop-in replacement.

Convert text with HTML tags, links, hashtags, mentions into NSAttributedString. Make them clickable with UILabel drop-in replacement.

A highly customizable drop-in replacement for UISegmentedControl.
A highly customizable drop-in replacement for UISegmentedControl.

HMSegmentedControl A highly customizable drop-in replacement for UISegmentedControl, used by more than 22,000 apps, including TikTok, PayPal, Imgur an

iOS7 style drop in replacement for UISwitch
iOS7 style drop in replacement for UISwitch

SevenSwitch iOS7 style drop in replacement for UISwitch Usage Cocoapods pod 'SevenSwitch', '~ 2.1' Swift support was added in version 2.0. If your p

Drop-in replacement for system() in iOS programs

ios_system: Drop-in replacement for system() in iOS programs When porting Unix utilities to iOS (vim, TeX, python...), sometimes the source code execu

UIPredicateEditor aims to be come a drop-in replacement of NSPredicateEditor for iOS, iPadOS and Mac Catalyst targets.

UIPredicateEditor UIPredicateEditor aims to be come a drop-in replacement of NSPredicateEditor for iOS, iPadOS and Mac Catalyst targets. The plan is t

A drop-in `NSComboButton` replacement with pre macOS 13 support.
A drop-in `NSComboButton` replacement with pre macOS 13 support.

DSFComboButton A drop-in NSComboButton replacement control with pre macOS 13 support. For when you want to adopt NSComboButton but have to maintain co

ETFKit - Designed to be a drop-in replacement for JSONDecoder/JSONEncoder

ETFKit Encoder/decoder for Erlang's External Term Format (version 131). Designed to be a drop-in replacement for JSONDecoder/JSONEncoder. Simply repla

Replacement of UIRefreshControl, and more functions.
Replacement of UIRefreshControl, and more functions.

ScrollEdgeControl Replacement of UIRefreshControl, and more functions. Overview ScrollEdgeControl is a UI component that is similar to UIRefreshContro

UICollectionView replacement of UITableView. Do even more like Parallax Header, Sticky Section Header. Made for iOS 7.

CSStickyHeaderFlowLayout Contributors For anyone who'd like to be a contributor to the repository, please read the Contribution Guideline Parallax, St

A simple way to create custom interactive UIViewController transitions
A simple way to create custom interactive UIViewController transitions

EasyTransitions is a library that helps developers create custom interactive transitions using simple functions defined in a protocol and avoid handli

Use PanGesture to dismiss view on UIViewController and UIView
Use PanGesture to dismiss view on UIViewController and UIView

PanSlip Use PanGesture to dismiss view on UIViewController and UIView. Introduction PanSlip to UIViewController left to right right to left top to bot

A TimeZonePicker UIViewController similar to the iOS Settings app. Search and select from a range of cities and countries to find your most suitable time zone.
A TimeZonePicker UIViewController similar to the iOS Settings app. Search and select from a range of cities and countries to find your most suitable time zone.

TimeZonePicker A TimeZonePicker UIViewController similar to the iOS Settings app. Search and select from a range of cities and countries to find your

A UIViewController subclass for Instagram authentication.
A UIViewController subclass for Instagram authentication.

InstagramAuthViewController A ViewController for Instagram authentication. A UIViewController subclass that handles showing the Instagram login page,

UIViewController subclass to beautifully present news articles and blog posts.
UIViewController subclass to beautifully present news articles and blog posts.

LMArticleViewController This framework allows you to create Apple News-inspired UIViewControllers with ease. It is heavily inspired by MRArticleViewCo

Showing / dismissing keyboard animation in simple UIViewController category.
Showing / dismissing keyboard animation in simple UIViewController category.

RSKKeyboardAnimationObserver Easy way to handle iOS keyboard showing/dismissing. Introduction Working with iOS keyboard demands a lot of duplicated co

Owner
Thomas Ricouard
[Entrepreneur, iOS/Mac & Web dev] Work @Medium / @Glose Past: @google, Co-Founded @MySeeen (Share movies !) @RobinBrowser (The smart Browser).
Thomas Ricouard
UIViewController drop in replacement with much more customisation

PopupViewController UIAlertController drop in replacement with much more customization You can literally replace UIAlertController by PopupViewControl

Thomas Ricouard 21 Jun 27, 2022
DrawerKit lets an UIViewController modally present another UIViewController in a manner similar to the way Apple's Maps app works.

DrawerKit What is DrawerKit? DrawerKit is a custom view controller presentation mimicking the kind of behaviour in the Apple Maps app. It lets any vie

Babylon Health 773 Dec 27, 2022
Codeless drop-in universal library allows to prevent issues of keyboard sliding up and cover UITextField/UITextView. Neither need to write any code nor any setup required and much more.

IQKeyboardManager While developing iOS apps, we often run into issues where the iPhone keyboard slides up and covers the UITextField/UITextView. IQKey

Mohd Iftekhar Qurashi 15.9k Jan 8, 2023
A drop-in replacement for UILabel that supports attributes, data detectors, links, and more

TTTAttributedLabel A drop-in replacement for UILabel that supports attributes, data detectors, links, and more TTTAttributedLabel is a drop-in replace

TTTAttributedLabel 8.8k Dec 30, 2022
Converts Markdown files and strings into NSAttributedStrings with lots of customisation options.

SwiftyMarkdown 1.0 SwiftyMarkdown converts Markdown files and strings into NSAttributedStrings using sensible defaults and a Swift-style syntax. It us

Simon Fairbairn 1.5k Dec 22, 2022
RxBluetoothKit is a Bluetooth library that makes interaction with BLE devices much more pleasant.

RxBluetoothKit is a Bluetooth library that makes interaction with BLE devices much more pleasant. It's backed by RxSwift and CoreBluetooth and it prov

Polidea 1.3k Jan 6, 2023
App Everything in one place (news, weather, stocks and much more)

Dashy Everything in one place (news, weather, stocks and much more) I tried to follow MVVM Pattern, Used Decodable And URLSession instead of thrid-par

Aayush 3 Nov 24, 2021
Simple library to detect motion type (walking, running, automotive) and count users steps. This library will make motion detection much more easily.

SOMotionDetector Simple library to detect motion for iOS by arturdev . Based on location updates and acceleration. ###Requierments iOS > 6.0 Compatibl

Artur  Mkrtchyan 1.1k Nov 25, 2022
iOS - Subclass of UITextField to achieve autocompletion for Place Search like Google Places, Uber and Much more apps having maps.

MVAutocompletePlaceSearchTextField iOS - Subclass of UITextField to achieve autocompletion for Place Search like Google Places, Uber and Much more app

Mrugrajsinh Vansadia 68 May 27, 2022
iOS app for the Valorant lineups, agents, crosshairs and much more

Valorant-Helper iOS app for the Valorant lineups, agents, crosshairs and much more(coming soon!) Agents FLOW On the first page there are agents and yo

Zuka 4 Sep 20, 2022