Display Apple system-like self-hiding status alerts. It is well suited for notifying user without interrupting user flow in iOS-like way.

Overview

StatusAlert is being sponsored by the following tool; please help to support us by takin a look and signing up to a free trial.

GitAds

Author StatusAlert

Swift Objective-C Wiki License Platform

Dependency managers

CocoaPods Carthage SwiftPackageManager

Features | Installation | Usage | Customization

StatusAlert is an iOS framework that displays status alerts similar to Apple's system self-hiding alerts. It is well suited for notifying user without interrupting user flow in iOS-like way.

It looks very similar to the alerts displayed in Podcasts, Apple Music and News apps. System StatusAlert

Features

  • System-like look and feel
  • Reduce transparency mode support
  • VoiceOver support
  • Safe Areas support
  • Universal (iPhone & iPad)
  • Objective-C support

Requirements

  • Xcode 9.0 or later
  • iOS 9.0 or later
  • Swift 3.2 or later

Installation

CocoaPods

To install StatusAlert using CocoaPods, add the following line to your Podfile:

pod 'StatusAlert', '~> 1.1.1'

Carthage

To install StatusAlert using Carthage, add the following line to your Cartfile:

github "LowKostKustomz/StatusAlert" ~> 1.1.1

Swift Package Manager

To install StatusAlert using Swift Package Manager add this to your dependencies in a Package.swift file:

dependencies: [
    .package(url: "https://github.com/LowKostKustomz/StatusAlert.git", .exact("1.1.1"))
]

Manual installation

You can also add this project:

  • as git submodule
  • simply download and copy source files to your project

Objective-C integration

StatusAlert is fully compatible with Objective-C. To import it to your project just add the following line:

@import StatusAlert;

Demo

Demo application is included in the StatusAlert workspace. To run it clone the repo.

Demo StatusAlert

Usage

// Importing framework
import StatusAlert

// Creating StatusAlert instance
let statusAlert = StatusAlert()
statusAlert.image = UIImage(named: "Some image name")
statusAlert.title = "StatusAlert title"
statusAlert.message = "Message to show beyond title"
statusAlert.canBePickedOrDismissed = isUserInteractionAllowed

// Presenting created instance
statusAlert.showInKeyWindow()

All the alert components (image, title, message) are optional, but at least one should be present. Otherwise show() method will be ignored.

IMPORTANT

The alert must be presented only from the main thread, otherwise application will crash with an appropriate error.

Customization

Wiki with more content and examples available

Different configurations

Present alert with any set of image, title and message

Vertical position

Display alert anywhere you want, either on the top, in the center or at the bottom of the view, and with any offset.

Appearance

You can customize a single alert's appearance via the StatusAlert's appearance property or for all alerts at once with StatusAlert.Appearance's common property

var titleFont: UIFont
var messageFont: UIFont
var tintColor: UIColor
var backgroundColor: UIColor
var blurStyle: UIBlurEffect.Style

Dismissal

Alert will hide itself after 2 seconds timeout.

You can change alert showing duration by setting alertShowingDuration property. You also can set canBePickedOrDismissed property to true. After that you will be able to dismiss the alert manually by tapping it and delay dismissal by long tapping the alert.

Apps Using StatusAlert


Bitxfy

BitxfyScreenShot


NotifyMe

NotifyMeScreenShot

Feel free to submit pull request if you are using this framework in your apps.

Author

Author ActionsList

https://twitter.com/LowKostKustomz https://www.instagram.com/lowkostkustomz/ https://stackoverflow.com/users/9076809/lowkostkustomz https://www.linkedin.com/in/yehor-miroshnychenko mierosh@gmail.com https://github.com/LowKostKustomz/Frameworks

License

The MIT License (MIT)

Copyright (c) 2017-2018 LowKostKustomz [email protected]

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

You might also like...
BPStatusBarAlert is a library that allows you to easily make text-based alert that appear on the status bar and below navigation bar.
BPStatusBarAlert is a library that allows you to easily make text-based alert that appear on the status bar and below navigation bar.

BPStatusBarAlert BPStatusBarAlert is a library that allows you to easily make text-based alert that appear on the status bar and below navigation bar.

SwiftEntryKit is a presentation library for iOS. It can be used to easily display overlays within your iOS apps.
SwiftEntryKit is a presentation library for iOS. It can be used to easily display overlays within your iOS apps.

SwiftEntryKit 🤗 Donations can be made here. Table of Contents Overview Features Example Project Example Project Installation Presets Playground Requi

Zingle – An alert will display underneath your UINavigationBar 🎅
Zingle – An alert will display underneath your UINavigationBar 🎅

Zingle Zingle – An alert will display underneath your UINavigationBar 🎅 💥 Note: Zingle has a dependency to have a UINavigationController in your app

Whisper is a component that will make the task of display messages and in-app notifications simple. It has three different views inside
Whisper is a component that will make the task of display messages and in-app notifications simple. It has three different views inside

Description 🍃 Break the silence of your UI, whispering, shouting or whistling at it. Whisper is a component that will make the task of displaying mes

Simple and elegant way to handle UIAlertController.
Simple and elegant way to handle UIAlertController.

SwiftyAlert SwiftAlert is simple and elegant way to handle UIAlertController. Feature Handle action with async/await Method chain Support UITextField

Native alert from Apple Music & Feedback. Contains Done, Heart & Message and other presets.
Native alert from Apple Music & Feedback. Contains Done, Heart & Message and other presets.

SPAlert Popup from Apple Music & Feedback in AppStore. Contains Done, Heart, Error and other presets. Supports Dark Mode. I tried to recreate Apple's

Native alert from Apple Music & Feedback. Contains Done, Heart & Message and other presets. Support SwiftUI.
Native alert from Apple Music & Feedback. Contains Done, Heart & Message and other presets. Support SwiftUI.

SPAlert Popup from Apple Music & Feedback in AppStore. Contains Done, Heart, Error and other presets. Supports Dark Mode. I tried to recreate Apple's

Snow globe framework is delightful / slightly cheese easter egg for christmas season. Turns your awesome app into a snow globe, when user shake the device.
Snow globe framework is delightful / slightly cheese easter egg for christmas season. Turns your awesome app into a snow globe, when user shake the device.

SnowGlobe.framework SnowGlobe.framework its easy to use, open source iOS framework written in swift. It allows you to ad delightful / cheesy Christmas

An iOS library for SwiftUI to create draggable sheet experiences similar to iOS applications like Maps and Stocks.

An iOS library for SwiftUI to create draggable sheet experiences similar to iOS applications like Maps and Stocks.

Comments
  • Background color is not changed.

    Background color is not changed.

    In the example project, I've tried to change background color from apperance but it doesn't work out.

        let statusAlert = StatusAlert()
        statusAlert.appearance.backgroundColor = .red
    

    It's withImage, title and message.

    bug 
    opened by mertnesvat 5
  • Update project to Swift 4.2

    Update project to Swift 4.2

    This commit updates the StatusAlert project to Swift 4.2, allowing it to compile in Xcode 10. The pod version number has not been changed.

    (resolves #5)

    opened by WilsonGramer 2
  • framework not found Pods_StatusAlertObjCDemo

    framework not found Pods_StatusAlertObjCDemo

    I'm getting the follow error, can't get passed it.

    ld: framework not found Pods_StatusAlertObjCDemo clang: error: linker command failed with exit code 1 (use -v to see invocation)

    opened by JulesMoorhouse 1
  • CocoaPods installation fails

    CocoaPods installation fails

    I tried to install the package as described in the README, but it fails with the following message printed in the terminal for pod install command:

    Analyzing dependencies [!] Unable to satisfy the following requirements:

    • StatusAlert (~> 0.10.1) required by Podfile

    None of your spec sources contain a spec satisfying the dependency: StatusAlert (~> 0.10.1).

    You have either:

    • out-of-date source repos which you can update with pod repo update or with pod install --repo-update.
    • mistyped the name or version.
    • not added the source repo that hosts the Podspec to your Podfile.

    Note: as of CocoaPods 1.0, pod repo update does not happen on pod install by default.

    The only workaround I found was to add just pod 'StatusAlert' to the podfile.

    opened by eposa 1
Releases(1.1.1)
  • 1.1.1(Apr 28, 2019)

  • 1.1.0(Dec 15, 2018)

    Source-breaking changes

    Old

    @objc public var defaultInitialScale: CGFloat
    @objc public var defaultCornerRadius: CGFloat
    
    @objc public var defaultTopOffset: CGFloat
    @objc public var defaultBottomOffset: CGFloat
    
    @objc public var defaultImageWidth: CGFloat
    @objc public var defaultAlertWidth: CGFloat
    
    @objc public var defaultImageBottomSpace: CGFloat
    @objc public var defaultTitleBottomSpace: CGFloat
    @objc public var defaultImageToMessageSpace: CGFloat
    

    New

    @objc public var initialScale: CGFloat
    @objc public var cornerRadius: CGFloat
    
    @objc public var topOffset: CGFloat
    @objc public var bottomOffset: CGFloat
    
    @objc public var imageWidth: CGFloat
    @objc public var alertWidth: CGFloat
    
    @objc public var imageBottomSpace: CGFloat
    @objc public var titleBottomSpace: CGFloat
    @objc public var imageToMessageSpace: CGFloat
    

    Fixed

    • Issue #7

    What's new

    • Added blurStyle property to appearance
    Source code(tar.gz)
    Source code(zip)
  • 0.12.2(Oct 25, 2018)

  • 0.12.1(Jul 15, 2018)

  • 0.12.0(Jul 7, 2018)

    Source-breaking changes

    Old

    let statusAlert = StatusAlert.instantiate(
        withImage: image,
        title: title,
        message: message,
        canBePickedOrDismissed: isPickable
    )
    

    New

    let statusAlert = StatusAlert()
    statusAlert.image = image
    statusAlert.title = title
    statusAlert.message = message
    statusAlert.canBePickedOrDismissed = isPickable
    

    Fixed

    • multiplePresentationsBehavior default value is .ignoreIfAlreadyPresenting now

    What's new

    • Added reusing some UI elements, such as UIImageViews, UILabels and space UIViews
    Source code(tar.gz)
    Source code(zip)
  • 0.11.0(May 26, 2018)

    Source-breaking changes

    shouldShowMultipleAlertsSimultaneously is now deprecated, use multiplePresentationsBehavior instead.

    Old

    StatusAlert.shouldShowMultipleAlertsSimultaneously = true
    

    New

    StatusAlert.multiplePresentationsBehavior = .showMultiple
    

    Fixed

    • Memory leak (lost a weak reference to self)
    Source code(tar.gz)
    Source code(zip)
  • 0.10.1(Feb 12, 2018)

  • 0.10.0(Jan 8, 2018)

    Source-breaking changes

    StatusAlert.Appearance structure

    now has common property, used by default by all alerts.

    Old

    StatusAlert.Appearance.contentColor = UIColor.black
    

    New

    // contentColor was renamed to tintColor
    StatusAlert.Appearance.common.tintColor = UIColor.black
    

    StatusAlert's appearance

    now can be set up with appearance property of type StatusAlert.Appearance. By default will be user StatusAlert.Appearance.common.

    Old

    statusAlert.contentColor = UIColor.black
    

    New

    statusAlert.appearance.tintColor = UIColor.black
    

    Vertical position offset

    no longer can be passed as associated value to enum case. Instead, offset can be passed as parameter to show method.

    Old

    statusAlert.show(withVerticalPosition: .center(offset: 8)
    

    New

    statusAlert.show(withVerticalPosition: .center, offset: 8)
    

    What's new

    • Added Objective-C support
    • Added Swift 3.2 support
    • Added VoiceOver support
    Source code(tar.gz)
    Source code(zip)
  • 0.9.4(Dec 31, 2017)

  • 0.9.3(Dec 31, 2017)

  • 0.9.2(Dec 9, 2017)

  • 0.9.1(Dec 9, 2017)

    Source-breaking changes

    You should no longer call prepare() method before showing StatusAlert.

    Old

    let statusAlert = StatusAlert.instantiate(
        withImage: UIImage(named: "Some image name"),
        title: "StatusAlert title",
        message: "Message to show beyond title",
        canBePickedOrDismissed: isUserInteractionAllowed)
    statusAlert.prepare()
    statusAlert.show(
        in: viewShowAlertIn,
        withVerticalPosition: .center(offset: 0))
    

    New

    let statusAlert = StatusAlert.instantiate(
        withImage: UIImage(named: "Some image name"),
        title: "StatusAlert title",
        message: "Message to show beyond title",
        canBePickedOrDismissed: isUserInteractionAllowed)
    // prepare() method called automatically before showing
    statusAlert.show(
        in: viewShowAlertIn,
        withVerticalPosition: .center(offset: 0))
    
    Source code(tar.gz)
    Source code(zip)
  • 0.9.0(Dec 9, 2017)

Owner
Yehor Miroshnychenko
iOS Developer
Yehor Miroshnychenko
It is a highly configurable iOS library which allows easy styling with built in styles as well as extra header and footer views so that you can make extremely unique alerts and action sheets.

 CFAlertViewController CFAlertViewController is a library that helps you display and customise Alerts, Action Sheets, and Notifications on iPad and i

Crowdfire Inc. 1.1k Dec 18, 2022
iOS tweak to display toasts for Low Power alerts and charging

Electrode iOS tweak to display toasts for Low Power alerts and charging. Localization Want to help translate Electrode to your language? Sumbit a pull

null 8 Sep 7, 2022
🚨Use the iPhone X Notch to display alerts. 🚨

NotchyAlert Prerequisites Xcode 9.x Swift 4.x iPhone X Simulator/Device Demo Installation Cocoapods To install NotchyAlert using Cocoapods, add the fo

Sofiane Beors 70 Nov 20, 2022
A µFramework for showing alerts like the one used when copying from pasteboard or connecting Apple pencil

Drops ?? A µFramework for showing alerts like the one used when copying from pasteboard or connecting Apple pencil. Features iOS 10+ Can be used in Sw

Omar Albeik 709 Dec 29, 2022
Create Apple-like alerts & toasts using SwiftUI

AlertToast-SwiftUI Present Apple-like alert & toast in SwiftUI ?? Example ?? Overview Currently in SwiftUI, the only way to inform the user about some

Elai Zuberman 1.1k Dec 29, 2022
Advance animated alerts for iOS written in Swift

LIHAlert LIHAlert provides animated banners for iOS. Updated to Swift 3 Demo Project The LIHAlert workspace contains a demo project, also used for dev

null 37 Dec 9, 2022
Easily create different alerts in SwiftUI

AlertWizard ????‍♂️ This package lets you easily create different alerts in SwiftUI with the call of a single function. As this is my first package th

null 3 Jun 3, 2021
Bursts 🔥 A Funny Framework is showing alerts, Have been Adapting Swift and SwiftUI

Bursts ?? A Funny Framework is showing alerts, Have been Adapting Swift and SwiftUI Features iOS 10+ Can be used in UIKit and SwiftUI applications Lig

Jovins 11 Apr 22, 2022
BeautyAlert - BeautyAlert provides alerts with custom shapes, colors, buttons

BeautyAlert helps you can easily design by determining the color, shape, and sha

chacha 17 Sep 8, 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