项目作者: TheAbstractDev

项目描述 :
🚨Use the iPhone X Notch to display alerts. 🚨
高级语言: Swift
项目地址: git://github.com/TheAbstractDev/NotchyAlert.git
创建时间: 2018-04-20T09:47:16Z
项目社区:https://github.com/TheAbstractDev/NotchyAlert

开源协议:MIT License

下载


NotchyAlert

Cocoapods compatible
Carthage compatible
Platform
License
Build Status

Prerequisites

  • Xcode 9.x
  • Swift 4.x
  • iPhone X Simulator/Device

Demo






Installation

Cocoapods

To install NotchyAlert using Cocoapods, add the following line to your Podfile:

  1. pod 'NotchyAlert'

Carthage

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

  1. github "TheAbstractDev/NotchyAlert"

Usage

First, you’ll need to import NotchyAlert

  1. import NotchyAlert

Title Only

  1. let notchy = Notchy(title: "Oops!", description: nil, image: nil)
  2. notchy.presentNotchy(in: self.view, duration: 3)

Title and Description

  1. let notchy = Notchy(title: "Oops!", description: "No Internet Connection.", image: nil)
  2. notchy.presentNotchy(in: self.view, duration: 3)

Title and Image

  1. let notchy = Notchy(title: "Oops!", description: nil, image: "<YOUR IMAGE>")
  2. notchy.presentNotchy(in: self.view, duration: 3)

Title, Decription and Image

  1. let notchy = Notchy(title: "Oops!", description: "No Internet Connection.", image: "<YOUR IMAGE>")
  2. notchy.presentNotchy(in: self.view, duration: 3)

Bounce Effect

By default, the bounce effect is true.
You can choose to disable the bounce effect by setting false on the call of presentNotchy

  1. notchy.presentNotchy(in: self.view, duration: 3, bounce: false)

Example

You can test it by downloading and run the Example project.

License

NotchyAlert is available under the MIT license. See the LICENSE file for more info.