https://github.com/lit-technology/error-view
Beautifully animated error view.
https://github.com/lit-technology/error-view
animated error-dialog error-display error-handling ios
Last synced: 8 months ago
JSON representation
Beautifully animated error view.
- Host: GitHub
- URL: https://github.com/lit-technology/error-view
- Owner: lit-technology
- License: mit
- Created: 2019-05-11T14:04:22.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2019-05-11T14:06:06.000Z (about 7 years ago)
- Last Synced: 2025-07-27T06:25:11.372Z (11 months ago)
- Topics: animated, error-dialog, error-display, error-handling, ios
- Language: Swift
- Size: 27.3 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Error View
[](https://travis-ci.org/philip-bui/error-view)
[](https://codecov.io/gh/philip-bui/error-view)
[](http://cocoapods.org/pods/ErrorView)
[](https://github.com/Carthage/Carthage)
[](http://cocoapods.org/pods/ErrorView)
[](https://github.com/philip-bui/error-view/blob/master/LICENSE)
Error View appendable to View Controllers subviews.
- Animated in and out effects.
- Text shake effects.
## Requirements
- iOS 9.0+
- Xcode 10.3+
- Swift 4.2+
## Installation
### CocoaPods
[CocoaPods](https://cocoapods.org) is a dependency manager for Cocoa projects. For usage and installation instructions, visit their website. To integrate Error View into your Xcode project using CocoaPods, specify it in your `Podfile`:
```ruby
pod 'ErrorView'
```
### Carthage
[Carthage](https://github.com/Carthage/Carthage) is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks. To integrate Error View into your Xcode project using Carthage, specify it in your `Cartfile`:
```ogdl
github "philip-bui/error-view"
```
### Swift Package Manager
The [Swift Package Manager](https://swift.org/package-manager/) is a tool for automating the distribution of Swift code and is integrated into the `swift` compiler. It is in early development, but Error View does support its use on supported platforms.
Once you have your Swift package set up, adding Error View as a dependency is as easy as adding it to the `dependencies` value of your `Package.swift`.
```swift
dependencies: [
.package(url: "https://github.com/philip-bui/error-view.git", from: "1.0.0"))
]
```
## Usage
```swift
import ErrorView
// AppDelegate.swift - Modify global defaults.
ErrorView.backgroundColor = UIColor.orange
ErrorView.font = UIFont.boldSystemFont(ofSize: 14.5)
ErrorView.textColor = UIFont.white
// ViewController.swift - Customize own error views
private weak var errorView: ErrorView?
private func textViewDidBeginEditing(_ textView: UITextView) {
errorView?.dismiss()
}
private func textViewDidEndEditing(_ textView: UITextView) {
guard true else {
errorView = ErrorView(addTo: self, text: "Invalid text")
return
}
}
```
## License
Error View is available under the MIT license. [See LICENSE](https://github.com/philip-bui/error-view/blob/master/LICENSE) for details.