Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jean-melikian/silverplate-ios
A system event helper for iOS
https://github.com/jean-melikian/silverplate-ios
cocoa-framework ios swift-3 swift-framework system-event xcode8
Last synced: about 8 hours ago
JSON representation
A system event helper for iOS
- Host: GitHub
- URL: https://github.com/jean-melikian/silverplate-ios
- Owner: jean-melikian
- License: bsd-3-clause
- Created: 2017-01-25T15:52:51.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-03-20T19:22:23.000Z (over 7 years ago)
- Last Synced: 2024-09-13T15:24:48.162Z (12 days ago)
- Topics: cocoa-framework, ios, swift-3, swift-framework, system-event, xcode8
- Language: Swift
- Size: 157 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SilverPlate Framework [![Build Status](https://travis-ci.org/SilverPlate-Framework/silverplate-ios.svg?branch=master)](https://travis-ci.org/SilverPlate-Framework/silverplate-ios)
___
## Description
__SilverPlate__ is a Swift3 framework which elegantly brings some of the most important system events to you.Easy to use, you do not need protocols/delegates nor to implement a gazillion methods into your neat classes as the __SilverPlate__ public API relies on simple closures.
___
## Implementation
- In a ViewController or any other class, to respond to reachability status change:```Swift3
import UIKit
import SilverPlateclass ViewController: UIViewController {
@IBOutlet weak var netStatusLabel: UILabel!override func viewDidLoad() {
super.viewDidLoad()
SilverPlate.shared.onInternetStatusChanged = { (status) in
self.netStatusLabel.text = "Connectivity status: \(status)"switch status {
case SilverPlate.Network.wifi:
// Do some heavy download
break
case SilverPlate.Network.cellular:
// Now easy with the data load
break
case SilverPlate.Network.none:
// Don't try to fetch anything from the web
break
}
}
}
}
```