Skip to content

Commit

Permalink
Updated Readme and docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanvorobei committed Nov 4, 2021
1 parent 1cdfeda commit dceb157
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 9 deletions.
Binary file modified Assets/Readme/spm-install-preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
18 changes: 13 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,14 @@ Ready for use on iOS 11+. Works with Swift 5+. Required Xcode 12.0 and higher.

### Swift Package Manager

The [Swift Package Manager](https://swift.org/package-manager/) is a tool for managing the distribution of Swift code. It’s integrated with the Swift build system to automate the process of downloading, compiling, and linking dependencies.
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’s integrated with the Swift build system to automate the process of downloading, compiling, and linking dependencies.

To integrate using Xcode 12, specify it in `File > Swift Packages > Add Package Dependency...`:
Once you have your Swift package set up, adding as a dependency is as easy as adding it to the `dependencies` value of your `Package.swift`.

```ogdl
https://github.com/ivanvorobei/SPAlert
```swift
dependencies: [
.package(url: "https://github.com/ivanvorobei/SPAlert", .upToNextMajor(from: "3.5.0"))
]
```

### CocoaPods:
Expand Down Expand Up @@ -112,7 +114,13 @@ alertView.duration = 4
alertView.present()
```

If you don't want to dimiss alert in time, set `dismissInTime` to `false`. After it `duration` property will be ignored.
If you don't want to dimiss alert in time, disable `dismissInTime`. After it `duration` property will be ignored.

```swift
alertView.dismissInTime = false
```

In this case you shoud dismiss alert manually.

### Layout

Expand Down
13 changes: 9 additions & 4 deletions Sources/SPAlert/SPAlertView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,24 @@ import UIKit
@available(iOSApplicationExtension, unavailable)
open class SPAlertView: UIView {

// MARK: - Properties

open var dismissByTap: Bool = true
open var completion: (() -> Void)? = nil

// MARK: - UIAppearance
// MARK: - Properties

/**
SPAlert: Wrapper of corner radius of alert.
*/
@objc dynamic open var cornerRadius: CGFloat = 8 {
didSet {
layer.cornerRadius = self.cornerRadius
}
}

/**
SPAlert: Dismiss alert by tap in any place inside. By default is on.
*/
@objc dynamic open var dismissByTap: Bool = true

/**
SPAlert: Automatically dismiss in time or not. Duration of dismiss can be changed by property `duration`.
*/
Expand Down

0 comments on commit dceb157

Please sign in to comment.