MIBlurPopup lets you create popups with a blurred background

Overview

MIBlurPopup

MIBlurPopup lets you create amazing popups with a blurred background

Platform Swift 4 Cocoapods Compatible

Setup

  1. Add pod 'MIBlurPopup' to your Podfile or copy the "MIBlurPopup.swift" into your project
  2. Make sure the view controller you want to present conforms the protocol MIBlurPopupDelegate
  3. Present the view controller with: MIBlurPopup.show(popupViewController, on: <some view controller>) or just set MIBlurPopupSegue as your custom segue's class like that

    NB: If you have added MIBlurPopup through pod, you also have to set the Module as "MIBlurPopup".

Customization

You can customize the popup behavior with the MIBlurPopupDelegate protocol

  • popupView: UIView // the view that contains the popup
  • blurEffectStyle: UIBlurEffectStyle // the blur effect style you want to apply to the background
  • initialScaleAmmount: CGFloat // ∈(0, 1), this property will be used to calculate size that the popupView will have at the begin of the presentation and at the end of the dismiss. When != 1 it will induce a zoom-effect.
  • animationDuration: TimeInterval // the transitions animations duration

TODO

  • Add a todo list
  • Add storyboard support (eg: with custom segue)

Demo

In this repository you can also find a demo.

Info

If you like this git you can follow me here or on twitter :) @MarioIannotta

Cheers from Italy!

Comments
  • UIView is nil

    UIView is nil

    When I try to present the ViewController using code

    PreMIBlurPopup.show(popupViewController, on: self), it gives me an error

    Fatal error: Unexpectedly found nil while unwrapping an Optional value

    opened by alielephant 7
  • Popup view controller sizing issue

    Popup view controller sizing issue

    I create my popup view controller as a separately with a xib file for reusability. It only contains an image view.

    import UIKit
    import MIBlurPopup
    
    class PopupViewController: UIViewController {
        @IBOutlet weak var imageView: UIImageView!
        
        override func viewDidLoad() {
            super.viewDidLoad()
            modalPresentationCapturesStatusBarAppearance = true
        }
        
        @IBAction func didTapdismissButton(_ sender: UIButton) {
            dismiss(animated: true)
        }
        
    }
    
    // MARK: - MIBlurPopupDelegate
    extension PopupViewController: MIBlurPopupDelegate {
        var popupView: UIView {
            return UIView()
        }
        
        var blurEffectStyle: UIBlurEffectStyle {
            return .dark
        }
        
        var initialScaleAmmount: CGFloat {
            return 0.7
        }
        
        var animationDuration: TimeInterval {
            return 0.3
        }
    }
    

    Then I show it like this.

    let popupViewController = PopupViewController()
    MIBlurPopup.show(popupViewController, on: self)
    

    But it looks like this when displayed.

    rsz_img_6678

    The image view is supposed to have a margin of 20 from the trailing side too. But it seems to be ignoring the auto layout constraints. I can't figure out what's wrong.

    I uploaded a demo project here.

    opened by Isuru-Nanayakkara 4
  • Presenting Nav Controller

    Presenting Nav Controller

    I am setting up a popover to be presented like this:

    
    let detailVC = storyboard?.instantiateViewController(withIdentifier: "Detail") as! DetailViewController     
    let navController = UINavigationController(rootViewController: detailVC)
    
    navController.modalPresentationStyle = .popover
            
    navController.popoverPresentationController?.sourceView = self.view
            
     navController.popoverPresentationController?.delegate = self as? UIPopoverPresentationControllerDelegate
            
    navController.popoverPresentationController?.sourceRect = CGRect(x: self.view.bounds.midX, y: self.view.bounds.midY, width: 0, height: 0)
            
     navController.preferredContentSize = CGSize(width: 450, height: 700)
            
     navController.popoverPresentationController?.permittedArrowDirections = UIPopoverArrowDirection(rawValue: 0)
            
     popoverPresentationController?.passthroughViews = nil
    

    I am trying to present it like this:

    MIBlurPopup.show(navController, on: self)

    My detailViewController conforms to the MIBlurDelegate but the nav controller doesnt. Is there a way for MIBlur to present a navigation controller? I would like my popover to be embedded in a nav controller.

    opened by martheli 4
  • Works with tab bar controller?

    Works with tab bar controller?

    Hi Mario, great library here, it makes the blurred background effect really easy! I'm wondering if it's possible for it to work with a navigation tab bar controller?

    I couldn't get it to work by changing the modalPresentationStyle to .full img_07605c426eb6-1

    opened by shaunjacobsen 3
  • SizeClass constraints aren't applied

    SizeClass constraints aren't applied

    When setting a custom width and height for the container view in the Regular width and height size class, and pinning the sides to the top, bottom, let and right in the compact size class, things get a bit weird.

    The height constraints are completely ignored.

    opened by anthonycastelli 2
  • UINavigationController Support

    UINavigationController Support

    can you add support for UINvavigationController() right now i believe only UIVIewcontrollers will show. I know i can add my own Navigation bar but adding a custom one does not have the same behavior as the default Navigation controller.

    opened by ghost 2
  • why not popup right away?

    why not popup right away?

    It's really a nice 3rdParty u made. I have a question,I have a tableview within tabbar controller. then after tableview didSelectRowAt func called. will popup the blure view. However the first time to click the cell, it works fine. but if I click other cells it will show up after quite a long time, or if I click the cell again ,then it show up. how can I fix this issue? Thank u

    opened by web8246 2
  • Tabbar doesn't hide

    Tabbar doesn't hide

    Thanks for the MIBlurPopup. I have a little problem. When showing the popup, tabbar shows up and I am unable to hide it in popupbar view controller too.

    opened by RajChanchal 2
Releases(1.0.0)
Owner
Mario Iannotta
Mobile Lead at @KeylessTech
Mario Iannotta
Toasts and popups library written with SwiftUI

Popup View Toasts and popups library written with SwiftUI We are a development agency building phenomenal apps. Usage Put all your body code into a ZS

Exyte 1.9k Jan 6, 2023
LNPopupController is a framework for presenting view controllers as popups of other view controllers, much like the Apple Music and Podcasts apps.

LNPopupController LNPopupController is a framework for presenting view controllers as popups of other view controllers, much like the Apple Music and

Leo Natan 2.9k Jan 2, 2023
The library allows to create simple popup menus

react-native-popup-menu This library allows to create simple popup menus Installation "react-native-popup-menu": "sergeymild/react-native-popup-menu"

SergeyMild 0 Aug 20, 2022
A Swift Popup Module help you popup your custom view easily

JFPopup JFPopup is a Swift Module help you popup your custom view easily. Support 3 way to popup, Drawer, Dialog and BottomSheet. Example To run the e

逸风 77 Dec 14, 2022
Creating a blurred window background in Mac Catalyst

TransparentChrome In response to a developer question, I looked for the easiest way to provide a translucent full-window chrome with a blurred backgro

Steven Troughton-Smith 37 Dec 2, 2022
Catalyst example using an AppKit-provided NSVisualEffectView to provide a translucent blurred window

CatalystEffectViewChrome This project demonstrates how to insert an NSVisualEffe

Steven Troughton-Smith 68 Aug 11, 2022
Create fully customizable popups easier than ever before ⚜️

FlexFlex Create fully customizable popups easier than ever before. ?? Installation FlexFlex requires iOS 13 and Xcode 12. 1️⃣ In Xcode go to File ➤ Ad

adri567 2 Aug 15, 2022
TomatoVerticalMenuMania lets you create a vertical, scrollable menu to the left of the screen.

TomatoVerticalMenuMania Framework Development and compatibility Development platform: iOS Language: Swift Compatibility: iOS 13 or greater Description

Tomato Software 0 Jan 11, 2022
Confetti View lets you create a magnificent confetti view in your app

ConfettiView Confetti View lets you create a magnificent confetti view in your app. This was inspired by House Party app's login screen. Written in Sw

Or Ron 234 Nov 22, 2022
Toasts and popups library written with SwiftUI

Popup View Toasts and popups library written with SwiftUI We are a development agency building phenomenal apps. Usage Put all your body code into a ZS

Exyte 1.9k Jan 5, 2023
SwiftOverlays is a Swift GUI library for displaying various popups and notifications

SwiftOverlays is a Swift GUI library for displaying various popups and notifications. SwiftOverlays animated logo is kindly made by Crafted Pixels Fea

Peter Prokop 632 Dec 22, 2022
An example of creating custom popups in SwiftUI

Custom Popup Example An example project for Implementing custom popups in SwiftUI article. Author Artem Novichkov, [email protected] License The

Artem Novichkov 37 Dec 10, 2022
Toasts and popups library written with SwiftUI

Popup View Toasts and popups library written with SwiftUI We are a development agency building phenomenal apps. Usage Put all your body code into a ZS

Exyte 1.9k Jan 6, 2023
LNPopupController is a framework for presenting view controllers as popups of other view controllers, much like the Apple Music and Podcasts apps.

LNPopupController LNPopupController is a framework for presenting view controllers as popups of other view controllers, much like the Apple Music and

Leo Natan 2.9k Jan 2, 2023
GUI library for displaying various popups (HUD), written in pure Swift.

SwiftNotice SwiftNotice is a GUI library for displaying various popups (HUD) written in pure Swift, fits any scrollview and supports iPhone X. Feature

John Lui 838 Dec 9, 2022
SwiftySound is a simple library that lets you deal with Swift sounds easily

SwiftySound Overview SwiftySound is a simple library that lets you deal with Swift sounds easily. Static methods Sound.play(file: "dog.wav") Sound.pla

Adam Cichy 1.1k Dec 17, 2022
HexColor is a simple extension that lets you initialize UIColors the way they were meant to be initialized: With hex integer values

HexColor is a simple extension that lets you initialize UIColors the way they were meant to be initialized: With hex integer values. Requirem

Tuomas Artman 103 Nov 24, 2022
Argo is a library that lets you extract models from JSON or similar structures in a way that's concise, type-safe, and easy to extend

Argo is a library that lets you extract models from JSON or similar structures in a way that's concise, type-safe, and easy to extend. Using Argo

thoughtbot, inc. 3.5k Dec 20, 2022
Rough lets you draw in a sketchy, hand-drawn-like, style.

Rough (Swift) Rough lets you draw in a sketchy, hand-drawn-like, style. It is Swift clone of Rough.js. The library defines primitives to draw lines, c

null 96 Nov 24, 2022