Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/TheAbstractDev/NotchyAlert
🚨Use the iPhone X Notch to display alerts. 🚨
https://github.com/TheAbstractDev/NotchyAlert
animation iphonex notch swift
Last synced: 7 days ago
JSON representation
🚨Use the iPhone X Notch to display alerts. 🚨
- Host: GitHub
- URL: https://github.com/TheAbstractDev/NotchyAlert
- Owner: TheAbstractDev
- License: mit
- Created: 2018-04-20T09:47:16.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-06-27T13:02:11.000Z (over 5 years ago)
- Last Synced: 2024-11-18T04:48:42.397Z (25 days ago)
- Topics: animation, iphonex, notch, swift
- Language: Swift
- Homepage:
- Size: 1.05 MB
- Stars: 71
- Watchers: 4
- Forks: 4
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-ios - NotchyAlert - Use the iPhone X notch space to display creative alerts. (UI / Alert & Action Sheet)
- awesome-ios-star - NotchyAlert - Use the iPhone X notch space to display creative alerts. (UI / Alert & Action Sheet)
README
# NotchyAlert
[![Cocoapods compatible](https://img.shields.io/badge/Cocoapods-compatible-4BC51D.svg?style=flat)](http://cocoapods.org)
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
[![Platform](https://img.shields.io/badge/Platform-iOS-lightgrey.svg)](https://developer.apple.com/)
[![License](https://img.shields.io/badge/license-MIT-999999.svg)](https://github.com/TheAbstractDev/NotchyAlert/blob/master/LICENSE)
[![Build Status](https://travis-ci.org/TheAbstractDev/NotchyAlert.svg?branch=master)](https://travis-ci.org)![](Screenshots/banner.png)
## Prerequisites
- Xcode 9.x
- Swift 4.x
- iPhone X Simulator/Device## Demo
## Installation
### Cocoapods
To install NotchyAlert using [Cocoapods](http://cocoapods.org), add the following line to your Podfile:```
pod 'NotchyAlert'
```### Carthage
To install NotchyAlert using [Carthage](https://github.com/Carthage/Carthage), add the following line to your Cartfile:```
github "TheAbstractDev/NotchyAlert"
```## Usage
First, you'll need to import NotchyAlert```swift
import NotchyAlert
```#### Title Only
```swift
let notchy = Notchy(title: "Oops!", description: nil, image: nil)
notchy.presentNotchy(in: self.view, duration: 3)
```#### Title and Description
```swift
let notchy = Notchy(title: "Oops!", description: "No Internet Connection.", image: nil)
notchy.presentNotchy(in: self.view, duration: 3)
```#### Title and Image
```swift
let notchy = Notchy(title: "Oops!", description: nil, image: "")
notchy.presentNotchy(in: self.view, duration: 3)
```#### Title, Decription and Image
```swift
let notchy = Notchy(title: "Oops!", description: "No Internet Connection.", image: "")
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`
```swift
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.