-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathREADME.md
87 lines (60 loc) · 2.63 KB
/
README.md
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# C2Alert
[![CI Status](http://img.shields.io/travis/c2mInc/C2Alert.svg?style=flat)](https://travis-ci.org/c2mInc/C2Alert)
[![Version](https://img.shields.io/cocoapods/v/C2Alert.svg?style=flat)](http://cocoapods.org/pods/C2Alert)
[![License](https://img.shields.io/cocoapods/l/C2Alert.svg?style=flat)](http://cocoapods.org/pods/C2Alert)
[![Platform](https://img.shields.io/cocoapods/p/C2Alert.svg?style=flat)](http://cocoapods.org/pods/C2Alert)
## About
C2Alert is a simple alert library with good and customizable design.
#### With Icon
<img src="https://cdn.pbrd.co/images/H3jkuoO.gif" width="250"><img src="https://cdn.pbrd.co/images/H3jkk8H.gif" width="250">
#### No Icon
<img src="https://cdn.pbrd.co/images/H3jjN6h.gif" width="250"><img src="https://cdn.pbrd.co/images/H3jkL7X.gif" width="250">
## Requirements
## Installation
C2Alert is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:
```ruby
pod 'C2Alert'
```
## Supported Swift Versions
| C2Alert Version | Swift Version | Min. iOS Version |
|----------|:-------------:|:-------------:|
| => 0.1.1 | Swift 5 | >= iOS 9.0 |
## Getting started
Create a C2Alert object with suitable initializer, then call the show function
### Usage
#### Basic
```swift
let alert = C2Alert(title: "Success", message: "You're doing great!", image: UIImage(named: "success_icon")!)
alert.show()
```
#### Available modifiers
```swift
let alert = C2Alert(title: "Success", message: "You're doing great!", image: UIImage(named: "success_icon")!)
alert.autoHideAfterSeconds = 5
alert.dialogBackgroundColor = .gray
alert.dialogImageColor = .black
alert.dialogMessageTextColor = .black
alert.dialogTitleTextColor = .black
alert.duration = 0.6 // This is show and hide animate duration
alert.hideOnBackgroundTouch = false // default true
alert.imageSize = CGSize(width: 100, height: 100)
alert.messageFont = UIFont(name: "Avenir-Roman", size: 15)!
alert.titleFont = UIFont(name: "Avenir-Heavy", size: 18)!
alert.overlay = true // default true
alert.overlayColor = .black // default black
alert.overlayOpacity = 0.3 // default 0.6
alert.paddingFromSides = 30 // default 32
alert.seperatorHeight = 8 // Space between title, message and image
alert.paddingTopAndBottom = 22 // default 24
alert.iconWithoutTintColor = true // default false. Use 'true' for custom image without tint
alert.show()
```
## Requirements
* iOS 9.0+
* Xcode 8.0+
* Swift 5.0+
## Author
[Connected2.me](http://connected2.me) / <a href="mailto:[email protected]">Berk Kaya</a>
## License
C2Alert is available under the MIT license. See the LICENSE file for more info.