Skip to content

Commit 33d2cf1

Browse files
committed
Merge branch 'release/1.2.1'
2 parents d1e1468 + 6015a92 commit 33d2cf1

File tree

3 files changed

+29
-2
lines changed

3 files changed

+29
-2
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,16 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66

77
## [Unreleased]
88

9+
## [1.2.1]
10+
11+
### Added
12+
13+
- SwiftUI `currentPath` example.
14+
15+
### Fixed
16+
17+
- Availability to the main class.
18+
919
## [1.2.0] - 2021-12-06
1020

1121
### Added

README.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,26 @@ if Reachability.shared.currentPath.isReachable {
2222
} else {
2323
print("No internet")
2424
}
25-
2625
```
2726

27+
### SwiftUI
28+
29+
```swift
30+
import SwiftUI
31+
import Reachability
32+
33+
struct SomeView: View {
34+
@ObservedObject var reachability = Reachability.shared
35+
36+
var body: some View {
37+
if reachability.currentPath.isReachable {
38+
// Show some data loaded from the internet
39+
} else {
40+
Text("No internet connection")
41+
}
42+
}
43+
}
44+
```
2845

2946
### Using Combine
3047

Sources/Reachability.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import Foundation
99
import Combine
1010
import Network
1111

12-
@available(macOS 10.13, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
12+
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
1313
public final class Reachability: ObservableObject {
1414
public static let shared = Reachability()
1515

0 commit comments

Comments
 (0)