Latest 1.1.0
Homepage https://github.com/daniel-barros/TemporaryAlert
License MIT
Platforms ios 9.0, requires ARC
Authors

Temporary alerts similar to those in Apple’s Music app.

Features:

  • Temporary and unobstrusive alerts.
  • Super-simple API.
  • Customizable appearance and behavior.
  • Built-in cross and checkmark images, the latter with a nice animation.

Usage

Showing an alert:

TemporaryAlert.show(image: .checkmark, title: "Added to your Library", message: nil)

Customizing alerts:

TemporaryAlert.Configuration.lifeSpan = 2
TemporaryAlert.Configuration.titleColor = .red

Example


Installation

CocoaPods

Install CocoaPods with the following command:

$ gem install cocoapods

Go to your project directory and create a Podfile with:

$ pod init

Add these lines to your Podfile:

use_frameworks!

target '<Your Target Name>' do
    pod 'TemporaryAlert'
end

Finally, run the following command:

$ pod install

Manually

Drag the whole project into your workspace, build it, and add the framework to the Embedded Binaries of your project.

Known issues

Xcode might generate a warning like this:

<UIVisualEffectView 0x0123456789> is being asked to animate its opacity. This will cause the effect to appear broken until opacity returns to 1.

However, you can safely ignore it. The result is as expected.
Anyone with a fix is welcome to create a pull request =).

Latest podspec

{
    "name": "TemporaryAlert",
    "version": "1.1.0",
    "summary": "Temporary alerts similar to those in Apple's Music app.",
    "homepage": "https://github.com/daniel-barros/TemporaryAlert",
    "license": {
        "type": "MIT",
        "file": "LICENSE.md"
    },
    "authors": {
        "Daniel Barros": "[email protected]"
    },
    "source": {
        "git": "https://github.com/daniel-barros/TemporaryAlert.git",
        "tag": "1.1.0"
    },
    "platforms": {
        "ios": "9.0"
    },
    "source_files": "TemporaryAlert/**/*.{h,swift}",
    "requires_arc": true,
    "pushed_with_swift_version": "4.0"
}

Pin It on Pinterest

Share This